("/search/{Query}");
29 |
30 | SetConfig(new HostConfig {
31 | WebHostUrl = baseUrl, //replaces ~/ with Url
32 | MarkdownBaseType = typeof(CustomMarkdownPage), //set custom base for all Markdown pages
33 | });
34 |
35 | var plugin = (MarkdownFormat)Plugins.First(x => x is MarkdownFormat);
36 | var page = plugin.FindByPathInfo("/about");
37 | }
38 | }
39 |
40 | public class Global : System.Web.HttpApplication
41 | {
42 | protected void Application_Start(object sender, EventArgs e)
43 | {
44 | new AppHost().Init();
45 | }
46 | }
47 | }
--------------------------------------------------------------------------------
/src/Docs/Views/Category.md:
--------------------------------------------------------------------------------
1 | @var Category = Model.Name
2 | @var Title = Category
3 |
4 | #### Category Pages
5 |
6 | @foreach page in Model.Results {
7 | - [@page.Name](@page.AbsoluteUrl)
8 | }
9 |
--------------------------------------------------------------------------------
/src/Docs/Views/Search.md:
--------------------------------------------------------------------------------
1 | @var Title = "Search results for " + Model.Query
2 |
3 | @if (Model.Results.Count == 0) {
4 |
5 | #### Your search did not match any documents.
6 |
7 | ## Suggestions:
8 |
9 | - Make sure all words are spelled correctly.
10 | - Try different keywords.
11 | - Try more general keywords.
12 | - Try fewer keywords.
13 | } else {
14 |
15 | #### Showing Results 1 - @Model.Results.Count
16 |
17 | ^
18 |
19 | @foreach page in Model.Results {
20 | ### @page.Category > [@page.Name](@page.AbsoluteUrl)
21 | @page.Content
22 | }
23 |
24 | ^
25 |
26 | }
--------------------------------------------------------------------------------
/src/Docs/Web.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
--------------------------------------------------------------------------------
/src/Docs/contrib/servicestack-contrib.md:
--------------------------------------------------------------------------------
1 | # Useful high-level App and use-case specific features and utils
2 |
3 |
4 | ##ServiceStack.ServiceInterface.dll
5 |
6 | Generic, Common and High-level functionality to assist with your web services implementation.
7 |
8 | The ServiceBase and RestServiceBase classes provide use-ful base classes for your web services to inherit from.
9 |
10 | #### ServiceBase - base class for RPC services
11 |
12 | * Handles C# exceptions and serializes them into your Response DTO's so your clients can programatically access them
13 | * If you have a IRedisClient installed, rolling error logs will be maintained so you can easily see the latest errors
14 | * **base.ResolveService()** - let's you access a pre-configured instance of another web service so you can delegate required functionality
15 | * **base.AppHost** - Accesses the underlying AppHost letting you inspect its configuration, etc
16 |
17 | #### RestServiceBase - base class for REST Services (extends ServiceBase)
18 |
19 | * Reduces the boiler-plate by already implementing all REST operations so you don't have to e.g. IRestGetService
20 |
21 |
22 | #### ServiceModel
23 | Generic DTO types useful for all web services. e.g. **ResponseStatus** is where C# exceptions get injected into
24 |
25 | #### Session
26 | Existing classes to help manage a users session
27 |
28 |
--------------------------------------------------------------------------------
/src/Docs/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ServiceStack/ServiceStack.Examples/1319489d46665b98751dc09c0dc4a3e27f17e624/src/Docs/favicon.ico
--------------------------------------------------------------------------------
/src/Docs/framework/home.md:
--------------------------------------------------------------------------------
1 | # Welcome to the ServiceStack wiki!
2 |
3 | Here you will find some documentations, articles, tutorials and other anecdotes on the ServiceStack Web Service Framework!
4 |
5 | Note: We're aware that documentation is a little sparse at the moment however it will be a top priority in the near future so be sure to check back soon!
6 |
7 | In the meantime we welcome you to look at the [Example projects](~/examples/servicestack-examples) to see how to quickly and easily build web services with ServiceStack. It is a conscience design decision to not to require any configuration and that the out-of-the-box installation is as useful as possible so it should be fairly easy to get started.
8 |
9 | ## Getting Started
10 | 1. View the [Hello World tutorial](http://www.servicestack.net/ServiceStack.Hello/) to see how to create a web service from scratch
11 | 2. The [MonoTouch Tutorial](http://www.servicestack.net/monotouch/remote-info/) is another geared towards calling web services from MonoTouch however the content should equally apply in most C# apps.
12 |
13 | ## Wiki Index
14 | 1. [ServiceStack Release Notes](~/framework/release-notes)
15 | 2. [ServiceStack's packages available on NuGet](~/framework/nuget)
16 | 3. [ServiceStack's new HTML5 Report Format](~/framework/json-report-format)
17 | 4. [ServiceStack's new CSV Format](~/framework/csv-format)
18 | 5. [Built-in caching options](~/framework/caching-options)
19 | 6. [Accessing the HTTP Request inside Web Services](~/framework/accessing-ihttprequest)
20 |
--------------------------------------------------------------------------------
/src/Docs/img/arr-2.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ServiceStack/ServiceStack.Examples/1319489d46665b98751dc09c0dc4a3e27f17e624/src/Docs/img/arr-2.gif
--------------------------------------------------------------------------------
/src/Docs/img/boat.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ServiceStack/ServiceStack.Examples/1319489d46665b98751dc09c0dc4a3e27f17e624/src/Docs/img/boat.jpg
--------------------------------------------------------------------------------
/src/Docs/img/date.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ServiceStack/ServiceStack.Examples/1319489d46665b98751dc09c0dc4a3e27f17e624/src/Docs/img/date.png
--------------------------------------------------------------------------------
/src/Docs/img/favicon.bmp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ServiceStack/ServiceStack.Examples/1319489d46665b98751dc09c0dc4a3e27f17e624/src/Docs/img/favicon.bmp
--------------------------------------------------------------------------------
/src/Docs/img/field.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ServiceStack/ServiceStack.Examples/1319489d46665b98751dc09c0dc4a3e27f17e624/src/Docs/img/field.gif
--------------------------------------------------------------------------------
/src/Docs/img/has_dropdown-hover.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ServiceStack/ServiceStack.Examples/1319489d46665b98751dc09c0dc4a3e27f17e624/src/Docs/img/has_dropdown-hover.png
--------------------------------------------------------------------------------
/src/Docs/img/ico-rss-2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ServiceStack/ServiceStack.Examples/1319489d46665b98751dc09c0dc4a3e27f17e624/src/Docs/img/ico-rss-2.png
--------------------------------------------------------------------------------
/src/Docs/img/ico-rss.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ServiceStack/ServiceStack.Examples/1319489d46665b98751dc09c0dc4a3e27f17e624/src/Docs/img/ico-rss.png
--------------------------------------------------------------------------------
/src/Docs/img/main-bg.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ServiceStack/ServiceStack.Examples/1319489d46665b98751dc09c0dc4a3e27f17e624/src/Docs/img/main-bg.jpg
--------------------------------------------------------------------------------
/src/Docs/img/main-bot.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ServiceStack/ServiceStack.Examples/1319489d46665b98751dc09c0dc4a3e27f17e624/src/Docs/img/main-bot.jpg
--------------------------------------------------------------------------------
/src/Docs/img/main-top.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ServiceStack/ServiceStack.Examples/1319489d46665b98751dc09c0dc4a3e27f17e624/src/Docs/img/main-top.jpg
--------------------------------------------------------------------------------
/src/Docs/img/meta-bg.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ServiceStack/ServiceStack.Examples/1319489d46665b98751dc09c0dc4a3e27f17e624/src/Docs/img/meta-bg.gif
--------------------------------------------------------------------------------
/src/Docs/img/meta-bot.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ServiceStack/ServiceStack.Examples/1319489d46665b98751dc09c0dc4a3e27f17e624/src/Docs/img/meta-bot.gif
--------------------------------------------------------------------------------
/src/Docs/img/meta-comments-num.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ServiceStack/ServiceStack.Examples/1319489d46665b98751dc09c0dc4a3e27f17e624/src/Docs/img/meta-comments-num.gif
--------------------------------------------------------------------------------
/src/Docs/img/meta-top.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ServiceStack/ServiceStack.Examples/1319489d46665b98751dc09c0dc4a3e27f17e624/src/Docs/img/meta-top.gif
--------------------------------------------------------------------------------
/src/Docs/img/nav-dd-arr.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ServiceStack/ServiceStack.Examples/1319489d46665b98751dc09c0dc4a3e27f17e624/src/Docs/img/nav-dd-arr.gif
--------------------------------------------------------------------------------
/src/Docs/img/post-bg.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ServiceStack/ServiceStack.Examples/1319489d46665b98751dc09c0dc4a3e27f17e624/src/Docs/img/post-bg.gif
--------------------------------------------------------------------------------
/src/Docs/img/searchform-field.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ServiceStack/ServiceStack.Examples/1319489d46665b98751dc09c0dc4a3e27f17e624/src/Docs/img/searchform-field.gif
--------------------------------------------------------------------------------
/src/Docs/img/sidebar-list-arr.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ServiceStack/ServiceStack.Examples/1319489d46665b98751dc09c0dc4a3e27f17e624/src/Docs/img/sidebar-list-arr.gif
--------------------------------------------------------------------------------
/src/Docs/img/textarea.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ServiceStack/ServiceStack.Examples/1319489d46665b98751dc09c0dc4a3e27f17e624/src/Docs/img/textarea.gif
--------------------------------------------------------------------------------
/src/Docs/img/widgettitle.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ServiceStack/ServiceStack.Examples/1319489d46665b98751dc09c0dc4a3e27f17e624/src/Docs/img/widgettitle.jpg
--------------------------------------------------------------------------------
/src/Docs/packages.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/src/Docs/packages/ServiceStack.4.0.11/ServiceStack.4.0.11.nupkg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ServiceStack/ServiceStack.Examples/1319489d46665b98751dc09c0dc4a3e27f17e624/src/Docs/packages/ServiceStack.4.0.11/ServiceStack.4.0.11.nupkg
--------------------------------------------------------------------------------
/src/Docs/packages/ServiceStack.4.0.11/lib/net40/ServiceStack.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ServiceStack/ServiceStack.Examples/1319489d46665b98751dc09c0dc4a3e27f17e624/src/Docs/packages/ServiceStack.4.0.11/lib/net40/ServiceStack.dll
--------------------------------------------------------------------------------
/src/Docs/packages/ServiceStack.Client.4.0.11/ServiceStack.Client.4.0.11.nupkg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ServiceStack/ServiceStack.Examples/1319489d46665b98751dc09c0dc4a3e27f17e624/src/Docs/packages/ServiceStack.Client.4.0.11/ServiceStack.Client.4.0.11.nupkg
--------------------------------------------------------------------------------
/src/Docs/packages/ServiceStack.Client.4.0.11/lib/net40/ServiceStack.Client.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ServiceStack/ServiceStack.Examples/1319489d46665b98751dc09c0dc4a3e27f17e624/src/Docs/packages/ServiceStack.Client.4.0.11/lib/net40/ServiceStack.Client.dll
--------------------------------------------------------------------------------
/src/Docs/packages/ServiceStack.Client.4.0.11/lib/sl5/ServiceStack.Client.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ServiceStack/ServiceStack.Examples/1319489d46665b98751dc09c0dc4a3e27f17e624/src/Docs/packages/ServiceStack.Client.4.0.11/lib/sl5/ServiceStack.Client.dll
--------------------------------------------------------------------------------
/src/Docs/packages/ServiceStack.Common.4.0.11/ServiceStack.Common.4.0.11.nupkg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ServiceStack/ServiceStack.Examples/1319489d46665b98751dc09c0dc4a3e27f17e624/src/Docs/packages/ServiceStack.Common.4.0.11/ServiceStack.Common.4.0.11.nupkg
--------------------------------------------------------------------------------
/src/Docs/packages/ServiceStack.Common.4.0.11/lib/net40/ServiceStack.Common.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ServiceStack/ServiceStack.Examples/1319489d46665b98751dc09c0dc4a3e27f17e624/src/Docs/packages/ServiceStack.Common.4.0.11/lib/net40/ServiceStack.Common.dll
--------------------------------------------------------------------------------
/src/Docs/packages/ServiceStack.Interfaces.4.0.11/ServiceStack.Interfaces.4.0.11.nupkg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ServiceStack/ServiceStack.Examples/1319489d46665b98751dc09c0dc4a3e27f17e624/src/Docs/packages/ServiceStack.Interfaces.4.0.11/ServiceStack.Interfaces.4.0.11.nupkg
--------------------------------------------------------------------------------
/src/Docs/packages/ServiceStack.Interfaces.4.0.11/lib/net40/ServiceStack.Interfaces.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ServiceStack/ServiceStack.Examples/1319489d46665b98751dc09c0dc4a3e27f17e624/src/Docs/packages/ServiceStack.Interfaces.4.0.11/lib/net40/ServiceStack.Interfaces.dll
--------------------------------------------------------------------------------
/src/Docs/packages/ServiceStack.Text.4.0.11/ServiceStack.Text.4.0.11.nupkg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ServiceStack/ServiceStack.Examples/1319489d46665b98751dc09c0dc4a3e27f17e624/src/Docs/packages/ServiceStack.Text.4.0.11/ServiceStack.Text.4.0.11.nupkg
--------------------------------------------------------------------------------
/src/Docs/packages/ServiceStack.Text.4.0.11/lib/net40/ServiceStack.Text.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ServiceStack/ServiceStack.Examples/1319489d46665b98751dc09c0dc4a3e27f17e624/src/Docs/packages/ServiceStack.Text.4.0.11/lib/net40/ServiceStack.Text.dll
--------------------------------------------------------------------------------
/src/Docs/packages/repositories.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/src/Docs/redis-admin-ui/redis-admin-ui-overview.md:
--------------------------------------------------------------------------------
1 | [Join the new google group](http://groups.google.com/group/servicestack) or
2 | follow [@demisbellot](http://twitter.com/demisbellot) and [@ServiceStack](http://twitter.com/servicestack)
3 | for twitter updates.
4 |
5 | #ServiceStack Redis Web Services including the Redis Admin UI
6 | Included is a ServiceStack web service layer which provide JSON, XML, JSV and SOAP 1.1/1.2 for all of Redis operations.
7 | Just like the RedisAdminUI this allows you to fully manage your redis-server instance using javascript from a browser.
8 |
9 | ##Live Demo
10 | A live demo of the RedisAdminUI can be found here [http://mono.servicestack.net/RedisAdminUI/AjaxClient/](http://mono.servicestack.net/RedisAdminUI/AjaxClient/)
11 |
12 | View the demos live list of the [available web services](http://www.servicestack.net/RedisAdminUI/servicestack/metadata).
13 |
14 |
15 | #Download
16 | [ServiceStack.RedisWebServices/downloads](https://github.com/ServiceStack/ServiceStack.RedisWebServices/downloads)
17 |
18 | ##Troubleshooting
19 | Note: if running via XSP you will want to change the 'DefaultRedirectPath' to:
20 |
21 |
22 |
--------------------------------------------------------------------------------
/src/Docs/redis-client/useful-redis-links.md:
--------------------------------------------------------------------------------
1 | Here are some links that will help you learn about and get started with Redis:
2 |
3 | * [Redis Home Page](http://redis.io/)
4 | * [Redis tutorial with ServiceStack.Redis](http://www.d80.co.uk/post/2011/05/12/Redis-Tutorial-with-ServiceStackRedis.aspx)
5 | * [NHibernate caching with Redis](http://www.d80.co.uk/post/2011/05/17/NHibernate-Caching-with-Redis.aspx)
6 | * [Main Project website](http://code.google.com/p/redis/)
7 | * [Mirror on GitHub](https://github.com/antirez/redis)
8 | * [A whirlwind tour of the next big thing in NoSQL data storage (PDF)](http://no.gd/redis-presentation.pdf)
9 | * [The Redis Book](http://redisbook.org/)
10 |
--------------------------------------------------------------------------------
/src/Docs/text-serializers/jsv-format.md:
--------------------------------------------------------------------------------
1 | # JSV Text Format (JSON + CSV)
2 |
3 | Type Serializer uses a hybrid CSV-style escaping + JavaScript-like text-based format that is optimized for both size and speed. I'm naming this JSV-format (i.e. JSON + CSV)
4 |
5 | In many ways it is similar to JavaScript, e.g. any List, Array, Collection of ints, longs, etc are stored in exactly the same way, i.e:
6 | [1,2,3,4,5]
7 |
8 | Any IDictionary is serialized like JavaScript, i.e:
9 | {A:1,B:2,C:3,D:4}
10 |
11 | Which also happens to be the same as C# POCO class with the values
12 |
13 | `new MyClass { A=1, B=2, C=3, D=4 }`
14 |
15 | {A:1,B:2,C:3,D:4}
16 |
17 | JSV is *white-space significant*, which means normal string values can be serialized without quotes, e.g:
18 |
19 | `new MyClass { Foo="Bar", Greet="Hello World!"}` is serialized as:
20 |
21 | {Foo:Bar,Greet:Hello World!}
22 |
23 |
24 | ### CSV escaping
25 |
26 | Any string with any of the following characters: `[]{},"`
27 | is escaped using CSV-style escaping where the value is wrapped in double quotes, e.g:
28 |
29 | `new MyClass { Name = "Me, Junior" }` is serialized as:
30 |
31 | {Name:"Me, Junior"}
32 |
33 | A value with a double-quote is escaped with another double quote e.g:
34 |
35 | `new MyClass { Size = "2\" x 1\"" }` is serialized as:
36 |
37 | {Size:"2"" x 1"""}
38 |
--------------------------------------------------------------------------------
/src/MonoTouch/RestFilesClient/Lib/RestFiles.ServiceModel.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ServiceStack/ServiceStack.Examples/1319489d46665b98751dc09c0dc4a3e27f17e624/src/MonoTouch/RestFilesClient/Lib/RestFiles.ServiceModel.dll
--------------------------------------------------------------------------------
/src/MonoTouch/RestFilesClient/Lib/ServiceStack.Common.MonoTouch.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ServiceStack/ServiceStack.Examples/1319489d46665b98751dc09c0dc4a3e27f17e624/src/MonoTouch/RestFilesClient/Lib/ServiceStack.Common.MonoTouch.dll
--------------------------------------------------------------------------------
/src/MonoTouch/RestFilesClient/Lib/ServiceStack.Interfaces.MonoTouch.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ServiceStack/ServiceStack.Examples/1319489d46665b98751dc09c0dc4a3e27f17e624/src/MonoTouch/RestFilesClient/Lib/ServiceStack.Interfaces.MonoTouch.dll
--------------------------------------------------------------------------------
/src/MonoTouch/RestFilesClient/Lib/ServiceStack.Text.MonoTouch.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ServiceStack/ServiceStack.Examples/1319489d46665b98751dc09c0dc4a3e27f17e624/src/MonoTouch/RestFilesClient/Lib/ServiceStack.Text.MonoTouch.dll
--------------------------------------------------------------------------------
/src/MonoTouch/RestFilesClient/RestFilesClient/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | MinimumOSVersion
6 | 3.0
7 | NSMainNibFile
8 | MainWindow
9 | UISupportedInterfaceOrientations
10 |
11 | UIInterfaceOrientationPortrait
12 | UIInterfaceOrientationPortraitUpsideDown
13 | UIInterfaceOrientationLandscapeLeft
14 | UIInterfaceOrientationLandscapeRight
15 |
16 |
17 |
18 |
--------------------------------------------------------------------------------
/src/MonoTouch/RestFilesClient/RestFilesClient/RestFiles.ServiceModel/Operations/Files.cs:
--------------------------------------------------------------------------------
1 | using System.ComponentModel;
2 | using System.Runtime.Serialization;
3 | using RestFiles.ServiceModel.Types;
4 | using ServiceStack.ServiceHost;
5 | using ServiceStack.ServiceInterface.ServiceModel;
6 |
7 | namespace RestFiles.ServiceModel.Operations
8 | {
9 | [Description("GET the File or Directory info at {Path}\n"
10 | + "POST multipart/formdata to upload a new file to any {Path} in the /ReadWrite folder\n"
11 | + "PUT {TextContents} to replace the contents of a text file in the /ReadWrite folder\n")]
12 | [RestService("/files")]
13 | [RestService("/files/{Path*}")]
14 | [DataContract]
15 | public class Files
16 | {
17 | [DataMember]
18 | public string Path { get; set; }
19 |
20 | [DataMember]
21 | public string TextContents { get; set; }
22 |
23 | [DataMember]
24 | public bool ForDownload { get; set; }
25 | }
26 |
27 | [DataContract]
28 | public class FilesResponse : IHasResponseStatus
29 | {
30 | [DataMember]
31 | public FolderResult Directory { get; set; }
32 |
33 | [DataMember]
34 | public FileResult File { get; set; }
35 |
36 | //Auto inject and serialize web service exceptions
37 | [DataMember] public ResponseStatus ResponseStatus { get; set; }
38 | }
39 | }
--------------------------------------------------------------------------------
/src/MonoTouch/RestFilesClient/RestFilesClient/RestFiles.ServiceModel/Operations/RevertFiles.cs:
--------------------------------------------------------------------------------
1 | using System.Runtime.Serialization;
2 | using ServiceStack.ServiceHost;
3 | using ServiceStack.ServiceInterface.ServiceModel;
4 |
5 | namespace RestFiles.ServiceModel.Operations
6 | {
7 | [RestService("revertfiles")]
8 | [DataContract]
9 | public class RevertFiles { }
10 |
11 | [DataContract]
12 | public class RevertFilesResponse : IHasResponseStatus
13 | {
14 | public RevertFilesResponse()
15 | {
16 | this.ResponseStatus = new ResponseStatus();
17 | }
18 |
19 | [DataMember]
20 | public ResponseStatus ResponseStatus { get; set; }
21 | }
22 | }
--------------------------------------------------------------------------------
/src/MonoTouch/RestFilesClient/RestFilesClient/RestFiles.ServiceModel/Types/File.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Runtime.Serialization;
3 |
4 | namespace RestFiles.ServiceModel.Types
5 | {
6 | [DataContract]
7 | public class File
8 | {
9 | [DataMember]
10 | public string Name { get; set; }
11 |
12 | [DataMember]
13 | public string Extension { get; set; }
14 |
15 | [DataMember]
16 | public long FileSizeBytes { get; set; }
17 |
18 | [DataMember]
19 | public DateTime ModifiedDate { get; set; }
20 |
21 | [DataMember]
22 | public bool IsTextFile { get; set; }
23 | }
24 | }
--------------------------------------------------------------------------------
/src/MonoTouch/RestFilesClient/RestFilesClient/RestFiles.ServiceModel/Types/FileResult.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Runtime.Serialization;
3 |
4 | namespace RestFiles.ServiceModel.Types
5 | {
6 | [DataContract]
7 | public class FileResult
8 | {
9 | [DataMember]
10 | public string Name { get; set; }
11 |
12 | [DataMember]
13 | public string Extension { get; set; }
14 |
15 | [DataMember]
16 | public long FileSizeBytes { get; set; }
17 |
18 | [DataMember]
19 | public DateTime ModifiedDate { get; set; }
20 |
21 | [DataMember]
22 | public bool IsTextFile { get; set; }
23 |
24 | [DataMember]
25 | public string Contents { get; set; }
26 | }
27 | }
--------------------------------------------------------------------------------
/src/MonoTouch/RestFilesClient/RestFilesClient/RestFiles.ServiceModel/Types/Folder.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Runtime.Serialization;
3 |
4 | namespace RestFiles.ServiceModel.Types
5 | {
6 | [DataContract]
7 | public class Folder
8 | {
9 | [DataMember]
10 | public string Name { get; set; }
11 |
12 | [DataMember]
13 | public DateTime ModifiedDate { get; set; }
14 |
15 | [DataMember]
16 | public int FileCount { get; set; }
17 | }
18 | }
--------------------------------------------------------------------------------
/src/MonoTouch/RestFilesClient/RestFilesClient/RestFiles.ServiceModel/Types/FolderResult.cs:
--------------------------------------------------------------------------------
1 | using System.Collections.Generic;
2 | using System.Runtime.Serialization;
3 |
4 | namespace RestFiles.ServiceModel.Types
5 | {
6 | [DataContract]
7 | public class FolderResult
8 | {
9 | public FolderResult()
10 | {
11 | Folders = new List();
12 | Files = new List();
13 | }
14 |
15 | [DataMember]
16 | public List Folders { get; set; }
17 |
18 | [DataMember]
19 | public List Files { get; set; }
20 | }
21 | }
--------------------------------------------------------------------------------
/src/MonoTouch/RestFilesClient/copy.sh:
--------------------------------------------------------------------------------
1 | cp /Users/mythz/src/ServiceStack.Text/src/ServiceStack.Text/bin/MonoTouch/*.dll Lib/
2 | cp /Users/mythz/src/ServiceStack.Examples/src/RestFiles/RestFiles.ServiceModel/bin/Release/RestFiles.ServiceModel.dll Lib/
--------------------------------------------------------------------------------
/src/RedisStackOverflow/RedisStackOverflow.ServiceInterface/AnswersService.cs:
--------------------------------------------------------------------------------
1 | using RedisStackOverflow.ServiceModel;
2 | using ServiceStack;
3 |
4 | namespace RedisStackOverflow.ServiceInterface
5 | {
6 |
7 | ///
8 | /// Create your ServiceStack rest-ful web service implementation.
9 | ///
10 | public class AnswersService : Service
11 | {
12 | ///
13 | /// Gets or sets the repository. The built-in IoC used with ServiceStack autowires this property.
14 | ///
15 | public IRepository Repository { get; set; }
16 |
17 | public void Post(Answers request)
18 | {
19 | Repository.StoreAnswer(new Answer
20 | {
21 | UserId = request.UserId,
22 | QuestionId = request.QuestionId,
23 | Content = request.Content
24 | });
25 | }
26 |
27 | public void Delete(Answers request)
28 | {
29 | Repository.DeleteAnswer(request.QuestionId, request.AnswerId);
30 | }
31 | }
32 | }
--------------------------------------------------------------------------------
/src/RedisStackOverflow/RedisStackOverflow.ServiceInterface/ResetService.cs:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ServiceStack/ServiceStack.Examples/1319489d46665b98751dc09c0dc4a3e27f17e624/src/RedisStackOverflow/RedisStackOverflow.ServiceInterface/ResetService.cs
--------------------------------------------------------------------------------
/src/RedisStackOverflow/RedisStackOverflow.ServiceInterface/StatsService.cs:
--------------------------------------------------------------------------------
1 | using RedisStackOverflow.ServiceModel;
2 | using ServiceStack;
3 |
4 | namespace RedisStackOverflow.ServiceInterface
5 | {
6 | ///
7 | /// Create your ServiceStack rest-ful web service implementation.
8 | ///
9 | public class StatsService : Service
10 | {
11 | ///
12 | /// Gets or sets the repository. The built-in IoC used with ServiceStack autowires this property.
13 | ///
14 | public IRepository Repository { get; set; }
15 |
16 | public StatsResponse Get(Stats request)
17 | {
18 | return new StatsResponse
19 | {
20 | Result = Repository.GetSiteStats()
21 | };
22 | }
23 | }
24 | }
--------------------------------------------------------------------------------
/src/RedisStackOverflow/RedisStackOverflow.ServiceInterface/packages.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/src/RedisStackOverflow/RedisStackOverflow.ServiceModel/Answers.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using ServiceStack;
3 |
4 | namespace RedisStackOverflow.ServiceModel
5 | {
6 | ///
7 | /// Define your ServiceStack web service request (i.e. the Request DTO).
8 | ///
9 | [Route("/answers")]
10 | public class Answers
11 | {
12 | public int UserId { get; set; }
13 | public int AnswerId { get; set; }
14 | public int QuestionId { get; set; }
15 | public string Content { get; set; }
16 | }
17 |
18 | public class Answer
19 | {
20 | public long Id { get; set; }
21 | public long QuestionId { get; set; }
22 | public long UserId { get; set; }
23 | public DateTime CreatedDate { get; set; }
24 | public string Content { get; set; }
25 | }
26 |
27 | public class AnswerResult
28 | {
29 | public Answer Answer { get; set; }
30 | public User User { get; set; }
31 | }
32 | }
--------------------------------------------------------------------------------
/src/RedisStackOverflow/RedisStackOverflow.ServiceModel/Reset.cs:
--------------------------------------------------------------------------------
1 | using ServiceStack;
2 |
3 | namespace RedisStackOverflow.ServiceModel
4 | {
5 | ///
6 | /// Define your ServiceStack web service request (i.e. the Request DTO).
7 | ///
8 | [Route("/reset")]
9 | public class Reset { }
10 |
11 | ///
12 | /// Define your ServiceStack web service response (i.e. Response DTO).
13 | ///
14 | public class ResetResponse : IHasResponseStatus
15 | {
16 | public ResetResponse()
17 | {
18 | //Comment this out if you wish to receive the response status.
19 | this.ResponseStatus = new ResponseStatus();
20 | }
21 |
22 | ///
23 | /// Gets or sets the ResponseStatus. The built-in Ioc used with ServiceStack autowires this property with service exceptions.
24 | ///
25 | public ResponseStatus ResponseStatus { get; set; }
26 | }
27 |
28 | }
--------------------------------------------------------------------------------
/src/RedisStackOverflow/RedisStackOverflow.ServiceModel/Stats.cs:
--------------------------------------------------------------------------------
1 | using System.Collections.Generic;
2 | using ServiceStack;
3 |
4 | namespace RedisStackOverflow.ServiceModel
5 | {
6 | ///
7 | /// Define your ServiceStack web service request (i.e. the Request DTO).
8 | ///
9 | [Route("/stats")]
10 | public class Stats { }
11 |
12 | public class SiteStats
13 | {
14 | public SiteStats()
15 | {
16 | this.TopTags = new List();
17 | }
18 |
19 | public int QuestionsCount { get; set; }
20 | public int AnswersCount { get; set; }
21 | public List TopTags { get; set; }
22 | }
23 |
24 | public class Tag
25 | {
26 | public string Name { get; set; }
27 | public int Score { get; set; }
28 | }
29 |
30 | ///
31 | /// Define your ServiceStack web service response (i.e. Response DTO).
32 | ///
33 | public class StatsResponse
34 | {
35 | public SiteStats Result { get; set; }
36 | }
37 |
38 | }
--------------------------------------------------------------------------------
/src/RedisStackOverflow/RedisStackOverflow.ServiceModel/packages.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/src/RedisStackOverflow/RedisStackOverflow/Content/Images/Mono-powered-big.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ServiceStack/ServiceStack.Examples/1319489d46665b98751dc09c0dc4a3e27f17e624/src/RedisStackOverflow/RedisStackOverflow/Content/Images/Mono-powered-big.png
--------------------------------------------------------------------------------
/src/RedisStackOverflow/RedisStackOverflow/Content/Images/arrow-down.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ServiceStack/ServiceStack.Examples/1319489d46665b98751dc09c0dc4a3e27f17e624/src/RedisStackOverflow/RedisStackOverflow/Content/Images/arrow-down.png
--------------------------------------------------------------------------------
/src/RedisStackOverflow/RedisStackOverflow/Content/Images/arrow-left.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ServiceStack/ServiceStack.Examples/1319489d46665b98751dc09c0dc4a3e27f17e624/src/RedisStackOverflow/RedisStackOverflow/Content/Images/arrow-left.png
--------------------------------------------------------------------------------
/src/RedisStackOverflow/RedisStackOverflow/Content/Images/bg-body-1024.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ServiceStack/ServiceStack.Examples/1319489d46665b98751dc09c0dc4a3e27f17e624/src/RedisStackOverflow/RedisStackOverflow/Content/Images/bg-body-1024.png
--------------------------------------------------------------------------------
/src/RedisStackOverflow/RedisStackOverflow/Content/Images/btn-github.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ServiceStack/ServiceStack.Examples/1319489d46665b98751dc09c0dc4a3e27f17e624/src/RedisStackOverflow/RedisStackOverflow/Content/Images/btn-github.png
--------------------------------------------------------------------------------
/src/RedisStackOverflow/RedisStackOverflow/Content/Images/delete_icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ServiceStack/ServiceStack.Examples/1319489d46665b98751dc09c0dc4a3e27f17e624/src/RedisStackOverflow/RedisStackOverflow/Content/Images/delete_icon.png
--------------------------------------------------------------------------------
/src/RedisStackOverflow/RedisStackOverflow/Content/Images/myvote-down.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ServiceStack/ServiceStack.Examples/1319489d46665b98751dc09c0dc4a3e27f17e624/src/RedisStackOverflow/RedisStackOverflow/Content/Images/myvote-down.png
--------------------------------------------------------------------------------
/src/RedisStackOverflow/RedisStackOverflow/Content/Images/myvote-up.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ServiceStack/ServiceStack.Examples/1319489d46665b98751dc09c0dc4a3e27f17e624/src/RedisStackOverflow/RedisStackOverflow/Content/Images/myvote-up.png
--------------------------------------------------------------------------------
/src/RedisStackOverflow/RedisStackOverflow/Content/Images/vote-down.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ServiceStack/ServiceStack.Examples/1319489d46665b98751dc09c0dc4a3e27f17e624/src/RedisStackOverflow/RedisStackOverflow/Content/Images/vote-down.png
--------------------------------------------------------------------------------
/src/RedisStackOverflow/RedisStackOverflow/Content/Images/vote-up.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ServiceStack/ServiceStack.Examples/1319489d46665b98751dc09c0dc4a3e27f17e624/src/RedisStackOverflow/RedisStackOverflow/Content/Images/vote-up.png
--------------------------------------------------------------------------------
/src/RedisStackOverflow/RedisStackOverflow/Global.asax:
--------------------------------------------------------------------------------
1 | <%@ Application Codebehind="Global.asax.cs" Inherits="RedisStackOverflow.Global" Language="C#" %>
2 |
--------------------------------------------------------------------------------
/src/RedisStackOverflow/RedisStackOverflow/packages.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/src/RedisStackOverflow/packages/ServiceStack.4.0.11/ServiceStack.4.0.11.nupkg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ServiceStack/ServiceStack.Examples/1319489d46665b98751dc09c0dc4a3e27f17e624/src/RedisStackOverflow/packages/ServiceStack.4.0.11/ServiceStack.4.0.11.nupkg
--------------------------------------------------------------------------------
/src/RedisStackOverflow/packages/ServiceStack.4.0.11/lib/net40/ServiceStack.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ServiceStack/ServiceStack.Examples/1319489d46665b98751dc09c0dc4a3e27f17e624/src/RedisStackOverflow/packages/ServiceStack.4.0.11/lib/net40/ServiceStack.dll
--------------------------------------------------------------------------------
/src/RedisStackOverflow/packages/ServiceStack.4.0.60/ServiceStack.4.0.60.nupkg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ServiceStack/ServiceStack.Examples/1319489d46665b98751dc09c0dc4a3e27f17e624/src/RedisStackOverflow/packages/ServiceStack.4.0.60/ServiceStack.4.0.60.nupkg
--------------------------------------------------------------------------------
/src/RedisStackOverflow/packages/ServiceStack.4.0.60/lib/net40/ServiceStack.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ServiceStack/ServiceStack.Examples/1319489d46665b98751dc09c0dc4a3e27f17e624/src/RedisStackOverflow/packages/ServiceStack.4.0.60/lib/net40/ServiceStack.dll
--------------------------------------------------------------------------------
/src/RedisStackOverflow/packages/ServiceStack.Client.4.0.11/ServiceStack.Client.4.0.11.nupkg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ServiceStack/ServiceStack.Examples/1319489d46665b98751dc09c0dc4a3e27f17e624/src/RedisStackOverflow/packages/ServiceStack.Client.4.0.11/ServiceStack.Client.4.0.11.nupkg
--------------------------------------------------------------------------------
/src/RedisStackOverflow/packages/ServiceStack.Client.4.0.11/lib/net40/ServiceStack.Client.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ServiceStack/ServiceStack.Examples/1319489d46665b98751dc09c0dc4a3e27f17e624/src/RedisStackOverflow/packages/ServiceStack.Client.4.0.11/lib/net40/ServiceStack.Client.dll
--------------------------------------------------------------------------------
/src/RedisStackOverflow/packages/ServiceStack.Client.4.0.11/lib/sl5/ServiceStack.Client.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ServiceStack/ServiceStack.Examples/1319489d46665b98751dc09c0dc4a3e27f17e624/src/RedisStackOverflow/packages/ServiceStack.Client.4.0.11/lib/sl5/ServiceStack.Client.dll
--------------------------------------------------------------------------------
/src/RedisStackOverflow/packages/ServiceStack.Client.4.0.60/ServiceStack.Client.4.0.60.nupkg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ServiceStack/ServiceStack.Examples/1319489d46665b98751dc09c0dc4a3e27f17e624/src/RedisStackOverflow/packages/ServiceStack.Client.4.0.60/ServiceStack.Client.4.0.60.nupkg
--------------------------------------------------------------------------------
/src/RedisStackOverflow/packages/ServiceStack.Client.4.0.60/lib/MonoAndroid/ServiceStack.Client.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ServiceStack/ServiceStack.Examples/1319489d46665b98751dc09c0dc4a3e27f17e624/src/RedisStackOverflow/packages/ServiceStack.Client.4.0.60/lib/MonoAndroid/ServiceStack.Client.dll
--------------------------------------------------------------------------------
/src/RedisStackOverflow/packages/ServiceStack.Client.4.0.60/lib/MonoAndroid/ServiceStack.Pcl.Android.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ServiceStack/ServiceStack.Examples/1319489d46665b98751dc09c0dc4a3e27f17e624/src/RedisStackOverflow/packages/ServiceStack.Client.4.0.60/lib/MonoAndroid/ServiceStack.Pcl.Android.dll
--------------------------------------------------------------------------------
/src/RedisStackOverflow/packages/ServiceStack.Client.4.0.60/lib/MonoTouch/ServiceStack.Client.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ServiceStack/ServiceStack.Examples/1319489d46665b98751dc09c0dc4a3e27f17e624/src/RedisStackOverflow/packages/ServiceStack.Client.4.0.60/lib/MonoTouch/ServiceStack.Client.dll
--------------------------------------------------------------------------------
/src/RedisStackOverflow/packages/ServiceStack.Client.4.0.60/lib/MonoTouch/ServiceStack.Pcl.iOS.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ServiceStack/ServiceStack.Examples/1319489d46665b98751dc09c0dc4a3e27f17e624/src/RedisStackOverflow/packages/ServiceStack.Client.4.0.60/lib/MonoTouch/ServiceStack.Pcl.iOS.dll
--------------------------------------------------------------------------------
/src/RedisStackOverflow/packages/ServiceStack.Client.4.0.60/lib/Xamarin.Mac20/ServiceStack.Client.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ServiceStack/ServiceStack.Examples/1319489d46665b98751dc09c0dc4a3e27f17e624/src/RedisStackOverflow/packages/ServiceStack.Client.4.0.60/lib/Xamarin.Mac20/ServiceStack.Client.dll
--------------------------------------------------------------------------------
/src/RedisStackOverflow/packages/ServiceStack.Client.4.0.60/lib/Xamarin.Mac20/ServiceStack.Pcl.Mac20.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ServiceStack/ServiceStack.Examples/1319489d46665b98751dc09c0dc4a3e27f17e624/src/RedisStackOverflow/packages/ServiceStack.Client.4.0.60/lib/Xamarin.Mac20/ServiceStack.Pcl.Mac20.dll
--------------------------------------------------------------------------------
/src/RedisStackOverflow/packages/ServiceStack.Client.4.0.60/lib/Xamarin.iOS10/ServiceStack.Client.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ServiceStack/ServiceStack.Examples/1319489d46665b98751dc09c0dc4a3e27f17e624/src/RedisStackOverflow/packages/ServiceStack.Client.4.0.60/lib/Xamarin.iOS10/ServiceStack.Client.dll
--------------------------------------------------------------------------------
/src/RedisStackOverflow/packages/ServiceStack.Client.4.0.60/lib/Xamarin.iOS10/ServiceStack.Pcl.iOS.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ServiceStack/ServiceStack.Examples/1319489d46665b98751dc09c0dc4a3e27f17e624/src/RedisStackOverflow/packages/ServiceStack.Client.4.0.60/lib/Xamarin.iOS10/ServiceStack.Pcl.iOS.dll
--------------------------------------------------------------------------------
/src/RedisStackOverflow/packages/ServiceStack.Client.4.0.60/lib/net40/ServiceStack.Client.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ServiceStack/ServiceStack.Examples/1319489d46665b98751dc09c0dc4a3e27f17e624/src/RedisStackOverflow/packages/ServiceStack.Client.4.0.60/lib/net40/ServiceStack.Client.dll
--------------------------------------------------------------------------------
/src/RedisStackOverflow/packages/ServiceStack.Client.4.0.60/lib/portable-net45+win8+monotouch+monoandroid+xamarin.ios10/ServiceStack.Client.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ServiceStack/ServiceStack.Examples/1319489d46665b98751dc09c0dc4a3e27f17e624/src/RedisStackOverflow/packages/ServiceStack.Client.4.0.60/lib/portable-net45+win8+monotouch+monoandroid+xamarin.ios10/ServiceStack.Client.dll
--------------------------------------------------------------------------------
/src/RedisStackOverflow/packages/ServiceStack.Client.4.0.60/lib/sl5/ServiceStack.Client.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ServiceStack/ServiceStack.Examples/1319489d46665b98751dc09c0dc4a3e27f17e624/src/RedisStackOverflow/packages/ServiceStack.Client.4.0.60/lib/sl5/ServiceStack.Client.dll
--------------------------------------------------------------------------------
/src/RedisStackOverflow/packages/ServiceStack.Client.4.0.60/lib/win/ServiceStack.Client.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ServiceStack/ServiceStack.Examples/1319489d46665b98751dc09c0dc4a3e27f17e624/src/RedisStackOverflow/packages/ServiceStack.Client.4.0.60/lib/win/ServiceStack.Client.dll
--------------------------------------------------------------------------------
/src/RedisStackOverflow/packages/ServiceStack.Client.4.0.60/lib/win/ServiceStack.Pcl.WinStore.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ServiceStack/ServiceStack.Examples/1319489d46665b98751dc09c0dc4a3e27f17e624/src/RedisStackOverflow/packages/ServiceStack.Client.4.0.60/lib/win/ServiceStack.Pcl.WinStore.dll
--------------------------------------------------------------------------------
/src/RedisStackOverflow/packages/ServiceStack.Client.4.0.60/lib/win/ServiceStack.Pcl.WinStore.pri:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ServiceStack/ServiceStack.Examples/1319489d46665b98751dc09c0dc4a3e27f17e624/src/RedisStackOverflow/packages/ServiceStack.Client.4.0.60/lib/win/ServiceStack.Pcl.WinStore.pri
--------------------------------------------------------------------------------
/src/RedisStackOverflow/packages/ServiceStack.Common.4.0.11/ServiceStack.Common.4.0.11.nupkg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ServiceStack/ServiceStack.Examples/1319489d46665b98751dc09c0dc4a3e27f17e624/src/RedisStackOverflow/packages/ServiceStack.Common.4.0.11/ServiceStack.Common.4.0.11.nupkg
--------------------------------------------------------------------------------
/src/RedisStackOverflow/packages/ServiceStack.Common.4.0.11/lib/net40/ServiceStack.Common.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ServiceStack/ServiceStack.Examples/1319489d46665b98751dc09c0dc4a3e27f17e624/src/RedisStackOverflow/packages/ServiceStack.Common.4.0.11/lib/net40/ServiceStack.Common.dll
--------------------------------------------------------------------------------
/src/RedisStackOverflow/packages/ServiceStack.Common.4.0.60/ServiceStack.Common.4.0.60.nupkg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ServiceStack/ServiceStack.Examples/1319489d46665b98751dc09c0dc4a3e27f17e624/src/RedisStackOverflow/packages/ServiceStack.Common.4.0.60/ServiceStack.Common.4.0.60.nupkg
--------------------------------------------------------------------------------
/src/RedisStackOverflow/packages/ServiceStack.Common.4.0.60/lib/net40/ServiceStack.Common.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ServiceStack/ServiceStack.Examples/1319489d46665b98751dc09c0dc4a3e27f17e624/src/RedisStackOverflow/packages/ServiceStack.Common.4.0.60/lib/net40/ServiceStack.Common.dll
--------------------------------------------------------------------------------
/src/RedisStackOverflow/packages/ServiceStack.Interfaces.4.0.11/ServiceStack.Interfaces.4.0.11.nupkg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ServiceStack/ServiceStack.Examples/1319489d46665b98751dc09c0dc4a3e27f17e624/src/RedisStackOverflow/packages/ServiceStack.Interfaces.4.0.11/ServiceStack.Interfaces.4.0.11.nupkg
--------------------------------------------------------------------------------
/src/RedisStackOverflow/packages/ServiceStack.Interfaces.4.0.11/lib/net40/ServiceStack.Interfaces.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ServiceStack/ServiceStack.Examples/1319489d46665b98751dc09c0dc4a3e27f17e624/src/RedisStackOverflow/packages/ServiceStack.Interfaces.4.0.11/lib/net40/ServiceStack.Interfaces.dll
--------------------------------------------------------------------------------
/src/RedisStackOverflow/packages/ServiceStack.Interfaces.4.0.60/ServiceStack.Interfaces.4.0.60.nupkg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ServiceStack/ServiceStack.Examples/1319489d46665b98751dc09c0dc4a3e27f17e624/src/RedisStackOverflow/packages/ServiceStack.Interfaces.4.0.60/ServiceStack.Interfaces.4.0.60.nupkg
--------------------------------------------------------------------------------
/src/RedisStackOverflow/packages/ServiceStack.Interfaces.4.0.60/lib/portable-wp80+sl5+net40+win8+wpa81+monotouch+monoandroid+xamarin.ios10/ServiceStack.Interfaces.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ServiceStack/ServiceStack.Examples/1319489d46665b98751dc09c0dc4a3e27f17e624/src/RedisStackOverflow/packages/ServiceStack.Interfaces.4.0.60/lib/portable-wp80+sl5+net40+win8+wpa81+monotouch+monoandroid+xamarin.ios10/ServiceStack.Interfaces.dll
--------------------------------------------------------------------------------
/src/RedisStackOverflow/packages/ServiceStack.Redis.4.0.11/ServiceStack.Redis.4.0.11.nupkg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ServiceStack/ServiceStack.Examples/1319489d46665b98751dc09c0dc4a3e27f17e624/src/RedisStackOverflow/packages/ServiceStack.Redis.4.0.11/ServiceStack.Redis.4.0.11.nupkg
--------------------------------------------------------------------------------
/src/RedisStackOverflow/packages/ServiceStack.Redis.4.0.11/lib/net40/ServiceStack.Redis.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ServiceStack/ServiceStack.Examples/1319489d46665b98751dc09c0dc4a3e27f17e624/src/RedisStackOverflow/packages/ServiceStack.Redis.4.0.11/lib/net40/ServiceStack.Redis.dll
--------------------------------------------------------------------------------
/src/RedisStackOverflow/packages/ServiceStack.Redis.4.0.60/ServiceStack.Redis.4.0.60.nupkg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ServiceStack/ServiceStack.Examples/1319489d46665b98751dc09c0dc4a3e27f17e624/src/RedisStackOverflow/packages/ServiceStack.Redis.4.0.60/ServiceStack.Redis.4.0.60.nupkg
--------------------------------------------------------------------------------
/src/RedisStackOverflow/packages/ServiceStack.Redis.4.0.60/lib/net40/ServiceStack.Redis.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ServiceStack/ServiceStack.Examples/1319489d46665b98751dc09c0dc4a3e27f17e624/src/RedisStackOverflow/packages/ServiceStack.Redis.4.0.60/lib/net40/ServiceStack.Redis.dll
--------------------------------------------------------------------------------
/src/RedisStackOverflow/packages/ServiceStack.Text.4.0.11/ServiceStack.Text.4.0.11.nupkg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ServiceStack/ServiceStack.Examples/1319489d46665b98751dc09c0dc4a3e27f17e624/src/RedisStackOverflow/packages/ServiceStack.Text.4.0.11/ServiceStack.Text.4.0.11.nupkg
--------------------------------------------------------------------------------
/src/RedisStackOverflow/packages/ServiceStack.Text.4.0.11/lib/net40/ServiceStack.Text.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ServiceStack/ServiceStack.Examples/1319489d46665b98751dc09c0dc4a3e27f17e624/src/RedisStackOverflow/packages/ServiceStack.Text.4.0.11/lib/net40/ServiceStack.Text.dll
--------------------------------------------------------------------------------
/src/RedisStackOverflow/packages/ServiceStack.Text.4.0.60/ServiceStack.Text.4.0.60.nupkg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ServiceStack/ServiceStack.Examples/1319489d46665b98751dc09c0dc4a3e27f17e624/src/RedisStackOverflow/packages/ServiceStack.Text.4.0.60/ServiceStack.Text.4.0.60.nupkg
--------------------------------------------------------------------------------
/src/RedisStackOverflow/packages/ServiceStack.Text.4.0.60/lib/net40/ServiceStack.Text.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ServiceStack/ServiceStack.Examples/1319489d46665b98751dc09c0dc4a3e27f17e624/src/RedisStackOverflow/packages/ServiceStack.Text.4.0.60/lib/net40/ServiceStack.Text.dll
--------------------------------------------------------------------------------
/src/RedisStackOverflow/packages/ServiceStack.Text.4.0.60/lib/portable-net45+win8+monotouch+monoandroid+xamarin.ios10/ServiceStack.Text.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ServiceStack/ServiceStack.Examples/1319489d46665b98751dc09c0dc4a3e27f17e624/src/RedisStackOverflow/packages/ServiceStack.Text.4.0.60/lib/portable-net45+win8+monotouch+monoandroid+xamarin.ios10/ServiceStack.Text.dll
--------------------------------------------------------------------------------
/src/RedisStackOverflow/packages/ServiceStack.Text.4.0.60/lib/sl5/ServiceStack.Text.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ServiceStack/ServiceStack.Examples/1319489d46665b98751dc09c0dc4a3e27f17e624/src/RedisStackOverflow/packages/ServiceStack.Text.4.0.60/lib/sl5/ServiceStack.Text.dll
--------------------------------------------------------------------------------
/src/RedisStackOverflow/packages/repositories.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/src/RestFiles/RestFiles.ServiceInterface/AppConfig.cs:
--------------------------------------------------------------------------------
1 | using System.Collections.Generic;
2 | using System.IO;
3 | using ServiceStack;
4 | using ServiceStack.Configuration;
5 |
6 | namespace RestFiles.ServiceInterface
7 | {
8 | public class AppConfig
9 | {
10 | public AppConfig()
11 | {
12 | this.TextFileExtensions = new List();
13 | this.ExcludeDirectories = new List();
14 | }
15 |
16 | public AppConfig(IAppSettings resources)
17 | {
18 | this.RootDirectory = resources.GetString("RootDirectory").MapHostAbsolutePath()
19 | .Replace('\\', Path.DirectorySeparatorChar);
20 |
21 | this.TextFileExtensions = resources.GetList("TextFileExtensions");
22 | this.ExcludeDirectories = resources.GetList("ExcludeDirectories");
23 | }
24 |
25 | public string RootDirectory { get; set; }
26 |
27 | public IList TextFileExtensions { get; set; }
28 |
29 | public IList ExcludeDirectories { get; set; }
30 | }
31 | }
--------------------------------------------------------------------------------
/src/RestFiles/RestFiles.ServiceInterface/Support/FileExtensions.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.IO;
3 |
4 | namespace RestFiles.ServiceInterface.Support
5 | {
6 | public static class FileExtensions
7 | {
8 | public static string GetSafePath(this string filePath)
9 | {
10 | if (string.IsNullOrEmpty(filePath)) return string.Empty;
11 |
12 | //Strip invalid chars
13 | foreach (var invalidChar in Path.GetInvalidPathChars())
14 | {
15 | filePath = filePath.Replace(invalidChar.ToString(), String.Empty);
16 | }
17 |
18 | return filePath
19 | .TrimStart('.', '/', '\\') //Remove illegal chars at the start
20 | .Replace('\\', '/') //Switch all to use the same seperator
21 | .Replace("../", String.Empty) //Remove access to top-level directories anywhere else
22 | .Replace('/', Path.DirectorySeparatorChar); //Switch all to use the OS seperator
23 | }
24 | }
25 | }
--------------------------------------------------------------------------------
/src/RestFiles/RestFiles.ServiceInterface/packages.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/src/RestFiles/RestFiles.ServiceModel/Files.cs:
--------------------------------------------------------------------------------
1 | using RestFiles.ServiceModel.Types;
2 | using ServiceStack;
3 |
4 | namespace RestFiles.ServiceModel
5 | {
6 | ///
7 | /// Define your ServiceStack web service request (i.e. the Request DTO).
8 | ///
9 | [Api("GET the File or Directory info at {Path}\n"
10 | + "POST multipart/formdata to upload a new file to any {Path} in the /ReadWrite folder\n"
11 | + "PUT {TextContents} to replace the contents of a text file in the /ReadWrite folder\n")]
12 | [Route("/files")]
13 | [Route("/files/{Path*}")]
14 | public class Files
15 | {
16 | public string Path { get; set; }
17 | public string TextContents { get; set; }
18 | public bool ForDownload { get; set; }
19 | }
20 |
21 | ///
22 | /// Define your ServiceStack web service response (i.e. Response DTO).
23 | ///
24 | public class FilesResponse : IHasResponseStatus
25 | {
26 | public FolderResult Directory { get; set; }
27 | public FileResult File { get; set; }
28 |
29 | ///
30 | /// Gets or sets the ResponseStatus. The built-in IoC used with ServiceStack autowires this property.
31 | ///
32 | public ResponseStatus ResponseStatus { get; set; }
33 | }
34 | }
--------------------------------------------------------------------------------
/src/RestFiles/RestFiles.ServiceModel/RevertFiles.cs:
--------------------------------------------------------------------------------
1 | using ServiceStack;
2 |
3 | namespace RestFiles.ServiceModel
4 | {
5 | ///
6 | /// Define your ServiceStack web service request (i.e. the Request DTO).
7 | ///
8 | [Route("/revertfiles")]
9 | public class RevertFiles { }
10 |
11 | ///
12 | /// Define your ServiceStack web service response (i.e. Response DTO).
13 | ///
14 | public class RevertFilesResponse : IHasResponseStatus
15 | {
16 | public RevertFilesResponse()
17 | {
18 | //Comment this out if you wish to receive the response status.
19 | this.ResponseStatus = new ResponseStatus();
20 | }
21 |
22 | ///
23 | /// Gets or sets the ResponseStatus. The built-in Ioc used with ServiceStack autowires this property with service exceptions.
24 | ///
25 | public ResponseStatus ResponseStatus { get; set; }
26 | }
27 | }
--------------------------------------------------------------------------------
/src/RestFiles/RestFiles.ServiceModel/Types/File.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace RestFiles.ServiceModel.Types
4 | {
5 | public class File
6 | {
7 | public string Name { get; set; }
8 | public string Extension { get; set; }
9 | public long FileSizeBytes { get; set; }
10 | public DateTime ModifiedDate { get; set; }
11 | public bool IsTextFile { get; set; }
12 | }
13 | }
--------------------------------------------------------------------------------
/src/RestFiles/RestFiles.ServiceModel/Types/FileResult.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace RestFiles.ServiceModel.Types
4 | {
5 | public class FileResult
6 | {
7 | public string Name { get; set; }
8 | public string Extension { get; set; }
9 | public long FileSizeBytes { get; set; }
10 | public DateTime ModifiedDate { get; set; }
11 | public bool IsTextFile { get; set; }
12 | public string Contents { get; set; }
13 | }
14 | }
--------------------------------------------------------------------------------
/src/RestFiles/RestFiles.ServiceModel/Types/Folder.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace RestFiles.ServiceModel.Types
4 | {
5 | public class Folder
6 | {
7 | public string Name { get; set; }
8 | public DateTime ModifiedDate { get; set; }
9 | public int FileCount { get; set; }
10 | }
11 | }
--------------------------------------------------------------------------------
/src/RestFiles/RestFiles.ServiceModel/Types/FolderResult.cs:
--------------------------------------------------------------------------------
1 | using System.Collections.Generic;
2 |
3 | namespace RestFiles.ServiceModel.Types
4 | {
5 | public class FolderResult
6 | {
7 | public FolderResult()
8 | {
9 | Folders = new List();
10 | Files = new List();
11 | }
12 |
13 | public List Folders { get; set; }
14 | public List Files { get; set; }
15 | }
16 | }
--------------------------------------------------------------------------------
/src/RestFiles/RestFiles.ServiceModel/packages.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/src/RestFiles/RestFiles.Tests/Support/RestFilesHttpListener.cs:
--------------------------------------------------------------------------------
1 | using Funq;
2 | using RestFiles.ServiceInterface;
3 | using ServiceStack;
4 |
5 | namespace RestFiles.Tests
6 | {
7 | public class RestFilesHttpListener
8 | : AppHostHttpListenerBase
9 | {
10 | public const string ListeningOn = "http://localhost:8080/";
11 |
12 | public RestFilesHttpListener()
13 | : base("HttpListener Hosts for Unit Tests", typeof(FilesService).Assembly) { }
14 |
15 | public AppConfig Config { get; set; }
16 |
17 | public override void Configure(Container container)
18 | {
19 | this.Config = new AppConfig
20 | {
21 | RootDirectory = "~/App_Data/files/".MapAbsolutePath(),
22 | TextFileExtensions = ".txt,.sln,.proj,.cs,.config,.asax".Split(','),
23 | };
24 | container.Register(this.Config);
25 |
26 | this.Start(ListeningOn);
27 | }
28 | }
29 | }
--------------------------------------------------------------------------------
/src/RestFiles/RestFiles.Tests/packages.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/src/RestFiles/RestFiles/Content/Images/1x1black-50a.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ServiceStack/ServiceStack.Examples/1319489d46665b98751dc09c0dc4a3e27f17e624/src/RestFiles/RestFiles/Content/Images/1x1black-50a.png
--------------------------------------------------------------------------------
/src/RestFiles/RestFiles/Content/Images/Chrome_logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ServiceStack/ServiceStack.Examples/1319489d46665b98751dc09c0dc4a3e27f17e624/src/RestFiles/RestFiles/Content/Images/Chrome_logo.png
--------------------------------------------------------------------------------
/src/RestFiles/RestFiles/Content/Images/Mono-powered-big.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ServiceStack/ServiceStack.Examples/1319489d46665b98751dc09c0dc4a3e27f17e624/src/RestFiles/RestFiles/Content/Images/Mono-powered-big.png
--------------------------------------------------------------------------------
/src/RestFiles/RestFiles/Content/Images/Mozilla_logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ServiceStack/ServiceStack.Examples/1319489d46665b98751dc09c0dc4a3e27f17e624/src/RestFiles/RestFiles/Content/Images/Mozilla_logo.png
--------------------------------------------------------------------------------
/src/RestFiles/RestFiles/Content/Images/Opera_logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ServiceStack/ServiceStack.Examples/1319489d46665b98751dc09c0dc4a3e27f17e624/src/RestFiles/RestFiles/Content/Images/Opera_logo.png
--------------------------------------------------------------------------------
/src/RestFiles/RestFiles/Content/Images/Safari_logo.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ServiceStack/ServiceStack.Examples/1319489d46665b98751dc09c0dc4a3e27f17e624/src/RestFiles/RestFiles/Content/Images/Safari_logo.jpg
--------------------------------------------------------------------------------
/src/RestFiles/RestFiles/Content/Images/bg-body-1024.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ServiceStack/ServiceStack.Examples/1319489d46665b98751dc09c0dc4a3e27f17e624/src/RestFiles/RestFiles/Content/Images/bg-body-1024.png
--------------------------------------------------------------------------------
/src/RestFiles/RestFiles/Content/Images/bg-footer.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ServiceStack/ServiceStack.Examples/1319489d46665b98751dc09c0dc4a3e27f17e624/src/RestFiles/RestFiles/Content/Images/bg-footer.png
--------------------------------------------------------------------------------
/src/RestFiles/RestFiles/Content/Images/bg_gradient.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ServiceStack/ServiceStack.Examples/1319489d46665b98751dc09c0dc4a3e27f17e624/src/RestFiles/RestFiles/Content/Images/bg_gradient.gif
--------------------------------------------------------------------------------
/src/RestFiles/RestFiles/Content/Images/btn-github.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ServiceStack/ServiceStack.Examples/1319489d46665b98751dc09c0dc4a3e27f17e624/src/RestFiles/RestFiles/Content/Images/btn-github.png
--------------------------------------------------------------------------------
/src/RestFiles/RestFiles/Content/Images/close-icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ServiceStack/ServiceStack.Examples/1319489d46665b98751dc09c0dc4a3e27f17e624/src/RestFiles/RestFiles/Content/Images/close-icon.png
--------------------------------------------------------------------------------
/src/RestFiles/RestFiles/Content/Images/delete_icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ServiceStack/ServiceStack.Examples/1319489d46665b98751dc09c0dc4a3e27f17e624/src/RestFiles/RestFiles/Content/Images/delete_icon.png
--------------------------------------------------------------------------------
/src/RestFiles/RestFiles/Content/Images/dir.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ServiceStack/ServiceStack.Examples/1319489d46665b98751dc09c0dc4a3e27f17e624/src/RestFiles/RestFiles/Content/Images/dir.png
--------------------------------------------------------------------------------
/src/RestFiles/RestFiles/Content/Images/file_head.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ServiceStack/ServiceStack.Examples/1319489d46665b98751dc09c0dc4a3e27f17e624/src/RestFiles/RestFiles/Content/Images/file_head.gif
--------------------------------------------------------------------------------
/src/RestFiles/RestFiles/Content/Images/ie8_logo.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ServiceStack/ServiceStack.Examples/1319489d46665b98751dc09c0dc4a3e27f17e624/src/RestFiles/RestFiles/Content/Images/ie8_logo.jpg
--------------------------------------------------------------------------------
/src/RestFiles/RestFiles/Content/Images/logo-24x24.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ServiceStack/ServiceStack.Examples/1319489d46665b98751dc09c0dc4a3e27f17e624/src/RestFiles/RestFiles/Content/Images/logo-24x24.png
--------------------------------------------------------------------------------
/src/RestFiles/RestFiles/Content/Images/logo-32x32.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ServiceStack/ServiceStack.Examples/1319489d46665b98751dc09c0dc4a3e27f17e624/src/RestFiles/RestFiles/Content/Images/logo-32x32.png
--------------------------------------------------------------------------------
/src/RestFiles/RestFiles/Content/Images/logo-txt-small.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ServiceStack/ServiceStack.Examples/1319489d46665b98751dc09c0dc4a3e27f17e624/src/RestFiles/RestFiles/Content/Images/logo-txt-small.png
--------------------------------------------------------------------------------
/src/RestFiles/RestFiles/Content/Images/public.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ServiceStack/ServiceStack.Examples/1319489d46665b98751dc09c0dc4a3e27f17e624/src/RestFiles/RestFiles/Content/Images/public.png
--------------------------------------------------------------------------------
/src/RestFiles/RestFiles/Content/Images/rip-ie6-300.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ServiceStack/ServiceStack.Examples/1319489d46665b98751dc09c0dc4a3e27f17e624/src/RestFiles/RestFiles/Content/Images/rip-ie6-300.jpg
--------------------------------------------------------------------------------
/src/RestFiles/RestFiles/Content/Images/row_bg.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ServiceStack/ServiceStack.Examples/1319489d46665b98751dc09c0dc4a3e27f17e624/src/RestFiles/RestFiles/Content/Images/row_bg.png
--------------------------------------------------------------------------------
/src/RestFiles/RestFiles/Content/Images/txt.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ServiceStack/ServiceStack.Examples/1319489d46665b98751dc09c0dc4a3e27f17e624/src/RestFiles/RestFiles/Content/Images/txt.png
--------------------------------------------------------------------------------
/src/RestFiles/RestFiles/Global.asax:
--------------------------------------------------------------------------------
1 | <%@ Application Codebehind="Global.asax.cs" Inherits="RestFiles.Global" Language="C#" %>
2 |
--------------------------------------------------------------------------------
/src/RestFiles/RestFiles/crossdomain.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
19 |
24 |
25 |
--------------------------------------------------------------------------------
/src/RestFiles/RestFiles/packages.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/src/RestIntro/RestIntro.IntegrationTests/packages.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/src/RestIntro/RestIntro.ServiceInterface/CustomerService.cs:
--------------------------------------------------------------------------------
1 | using RestIntro.ServiceModel;
2 | using ServiceStack;
3 | using ServiceStack.OrmLite;
4 |
5 | namespace RestIntro.ServiceInterface
6 | {
7 | ///
8 | /// Create your ServiceStack rest-ful web service implementation.
9 | ///
10 | public class CustomerService : Service
11 | {
12 | public object Get(Customer request)
13 | {
14 | if (request.Id != default(long))
15 | return Db.SingleById(request.Id);
16 |
17 | return Db.Select();
18 | }
19 |
20 | public object Post(Customer customer)
21 | {
22 | Db.Save(customer);
23 |
24 | var pathToNewResource = base.Request.AbsoluteUri.CombineWith(customer.Id.ToString());
25 | return HttpResult.Status201Created(customer, pathToNewResource);
26 | }
27 |
28 | public Customer Put(Customer customer)
29 | {
30 | Db.Save(customer);
31 | return customer;
32 | }
33 |
34 | public void Delete(Customer request)
35 | {
36 | Db.DeleteById(request.Id);
37 | }
38 | }
39 | }
--------------------------------------------------------------------------------
/src/RestIntro/RestIntro.ServiceInterface/packages.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/src/RestIntro/RestIntro.ServiceModel/Customer.cs:
--------------------------------------------------------------------------------
1 | using ServiceStack;
2 | using ServiceStack.DataAnnotations;
3 |
4 | namespace RestIntro.ServiceModel
5 | {
6 | ///
7 | /// Define your ServiceStack web service request (i.e. Request DTO).
8 | ///
9 | /// The route is defined here rather than in the AppHost.
10 | [Route("/customers")]
11 | [Route("/customers/{Id}")]
12 | public class Customer
13 | {
14 | [AutoIncrement] //OrmLite hint
15 | public int Id { get; set; }
16 | public string Name { get; set; }
17 | public int Age { get; set; }
18 | public string Email { get; set; }
19 | }
20 | }
--------------------------------------------------------------------------------
/src/RestIntro/RestIntro.ServiceModel/packages.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/src/RestIntro/RestIntro/Global.asax:
--------------------------------------------------------------------------------
1 | <%@ Application Codebehind="Global.asax.cs" Inherits="RestIntro.Global" Language="C#" %>
2 |
--------------------------------------------------------------------------------
/src/RestIntro/RestIntro/RestIntro.sqlite:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ServiceStack/ServiceStack.Examples/1319489d46665b98751dc09c0dc4a3e27f17e624/src/RestIntro/RestIntro/RestIntro.sqlite
--------------------------------------------------------------------------------
/src/RestIntro/RestIntro/default.htm:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | ServiceStack REST Intro Example
5 |
11 |
12 |
13 |
14 | ServiceStack REST Intro Example
15 |
16 | Create new Contact
17 |
18 |
26 |
27 |
28 |
29 |
--------------------------------------------------------------------------------
/src/RestIntro/RestIntro/packages.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/src/RestIntro/RestIntro/sqlite3.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ServiceStack/ServiceStack.Examples/1319489d46665b98751dc09c0dc4a3e27f17e624/src/RestIntro/RestIntro/sqlite3.dll
--------------------------------------------------------------------------------
/src/ServiceStack.Examples/ServiceStack.Examples.Clients.Silverlight/App.xaml:
--------------------------------------------------------------------------------
1 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/src/ServiceStack.Examples/ServiceStack.Examples.Clients.Silverlight/AppContext.cs:
--------------------------------------------------------------------------------
1 | using ServiceStack.Service;
2 | using SilverlightStack.ServiceClient;
3 |
4 | namespace ServiceStack.Examples.Clients.Silverlight
5 | {
6 | public class AppContext
7 | {
8 | public static AppContext Instance = new AppContext();
9 |
10 | public IAsyncServiceClient ServiceClient { get; private set; }
11 |
12 | public ExampleContext ExampleContext { get; private set; }
13 |
14 |
15 | private AppContext()
16 | {
17 | this.ServiceClient = new XmlAsyncServiceClient("http://www.servicestack.net/ServiceStack.Examples.Host.Web/ServiceStack/Xml/SyncReply");
18 |
19 | this.ExampleContext = new ExampleContext(this.ServiceClient, this);
20 | }
21 |
22 | }
23 | }
--------------------------------------------------------------------------------
/src/ServiceStack.Examples/ServiceStack.Examples.Clients.Silverlight/DataEventArgs.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Net;
3 | using System.Windows;
4 | using System.Windows.Controls;
5 | using System.Windows.Documents;
6 | using System.Windows.Ink;
7 | using System.Windows.Input;
8 | using System.Windows.Media;
9 | using System.Windows.Media.Animation;
10 | using System.Windows.Shapes;
11 |
12 | namespace ServiceStack.Examples.Clients.Silverlight
13 | {
14 | public class DataEventArgs : EventArgs
15 | {
16 | public object Data { get; private set; }
17 |
18 | public Type Type { get; private set; }
19 |
20 | public Exception Exception { get; private set; }
21 |
22 | public DataEventArgs(object data)
23 | {
24 | Data = data;
25 | }
26 |
27 | public DataEventArgs(object data, Type type)
28 | : this(data)
29 | {
30 | Type = type;
31 | }
32 |
33 | public DataEventArgs(object data, Exception exception)
34 | : this(data)
35 | {
36 | Exception = exception;
37 | }
38 |
39 | public bool IsSuccess
40 | {
41 | get { return this.Exception == null; }
42 | }
43 |
44 | public bool IsSuccessAndOfType()
45 | {
46 | return this.IsSuccess && this.Data.GetType() == typeof(T);
47 | }
48 |
49 | public T GetData()
50 | where T : class
51 | {
52 | return this.Data as T;
53 | }
54 |
55 | }
56 | }
--------------------------------------------------------------------------------
/src/ServiceStack.Examples/ServiceStack.Examples.Clients.Silverlight/Properties/AppManifest.xml:
--------------------------------------------------------------------------------
1 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/src/ServiceStack.Examples/ServiceStack.Examples.Clients.Silverlight/Types/ArrayOfLong.cs:
--------------------------------------------------------------------------------
1 | using System.Collections.Generic;
2 | using System.Runtime.Serialization;
3 |
4 | namespace ServiceStack.Examples.ServiceInterface.Types
5 | {
6 | [CollectionDataContract(ItemName = "long")]
7 | public class ArrayOfLong : List
8 | {
9 | public ArrayOfLong() { }
10 | public ArrayOfLong(IEnumerable collection) : base(collection) { }
11 | public ArrayOfLong(params long[] collection) : base(collection) { }
12 | }
13 | }
--------------------------------------------------------------------------------
/src/ServiceStack.Examples/ServiceStack.Examples.Clients.Silverlight/Types/ArrayOfString.cs:
--------------------------------------------------------------------------------
1 | using System.Collections.Generic;
2 | using System.Runtime.Serialization;
3 |
4 | namespace ServiceStack.Examples.ServiceInterface.Types
5 | {
6 | [CollectionDataContract(ItemName = "string")]
7 | public class ArrayOfString : List
8 | {
9 | public ArrayOfString() { }
10 | public ArrayOfString(IEnumerable collection) : base(collection) { }
11 | public ArrayOfString(params string[] collection) : base(collection) { }
12 | }
13 | }
--------------------------------------------------------------------------------
/src/ServiceStack.Examples/ServiceStack.Examples.Clients.Silverlight/Types/ArrayOfUser.cs:
--------------------------------------------------------------------------------
1 | using System.Collections.Generic;
2 | using System.Runtime.Serialization;
3 |
4 | namespace ServiceStack.Examples.ServiceInterface.Types
5 | {
6 | [CollectionDataContract(ItemName = "User")]
7 | public class ArrayOfUser : List
8 | {
9 | public ArrayOfUser() { }
10 | public ArrayOfUser(IEnumerable collection) : base(collection) { }
11 | }
12 | }
--------------------------------------------------------------------------------
/src/ServiceStack.Examples/ServiceStack.Examples.Clients.Silverlight/Types/DeleteAllUsers.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Runtime.Serialization;
5 | using System.Text;
6 |
7 | namespace ServiceStack.Examples.ServiceInterface.Types
8 | {
9 | ///
10 | /// Use Plain old DataContract's Define your 'Service Interface'
11 | ///
12 | [DataContract]
13 | public class DeleteAllUsers
14 | {
15 | }
16 |
17 | [DataContract]
18 | public class DeleteAllUsersResponse
19 | {
20 | public DeleteAllUsersResponse()
21 | {
22 | this.ResponseStatus = new ResponseStatus();
23 | }
24 |
25 | [DataMember]
26 | public long UserId { get; set; }
27 |
28 | [DataMember]
29 | public ResponseStatus ResponseStatus { get; set; }
30 | }
31 | }
--------------------------------------------------------------------------------
/src/ServiceStack.Examples/ServiceStack.Examples.Clients.Silverlight/Types/GetFactorial.cs:
--------------------------------------------------------------------------------
1 | using System.Runtime.Serialization;
2 |
3 | namespace ServiceStack.Examples.ServiceInterface.Types
4 | {
5 | ///
6 | /// Use Plain old DataContract's Define your 'Service Interface'
7 | ///
8 | [DataContract]
9 | public class GetFactorial
10 | {
11 | [DataMember]
12 | public long ForNumber { get; set; }
13 | }
14 |
15 | [DataContract]
16 | public class GetFactorialResponse
17 | {
18 | [DataMember]
19 | public long Result { get; set; }
20 | }
21 | }
--------------------------------------------------------------------------------
/src/ServiceStack.Examples/ServiceStack.Examples.Clients.Silverlight/Types/GetFibonacciNumbers.cs:
--------------------------------------------------------------------------------
1 | using System.Runtime.Serialization;
2 |
3 | namespace ServiceStack.Examples.ServiceInterface.Types
4 | {
5 | ///
6 | /// Use Plain old DataContract's Define your 'Service Interface'
7 | ///
8 | [DataContract]
9 | public class GetFibonacciNumbers
10 | {
11 | [DataMember]
12 | public long? Skip { get; set; }
13 |
14 | [DataMember]
15 | public long? Take { get; set; }
16 | }
17 |
18 | [DataContract]
19 | public class GetFibonacciNumbersResponse
20 | {
21 | [DataMember]
22 | public ArrayOfLong Results { get; set; }
23 | }
24 | }
--------------------------------------------------------------------------------
/src/ServiceStack.Examples/ServiceStack.Examples.Clients.Silverlight/Types/GetUsers.cs:
--------------------------------------------------------------------------------
1 | using System.Linq;
2 | using System.Runtime.Serialization;
3 |
4 | namespace ServiceStack.Examples.ServiceInterface.Types
5 | {
6 | ///
7 | /// Use Plain old DataContract's Define your 'Service Interface'
8 | ///
9 | [DataContract]
10 | public class GetUsers
11 | {
12 | [DataMember]
13 | public ArrayOfLong UserIds { get; set; }
14 |
15 | [DataMember]
16 | public ArrayOfString UserNames { get; set; }
17 | }
18 |
19 | [DataContract]
20 | public class GetUsersResponse
21 | {
22 | public GetUsersResponse()
23 | {
24 | this.ResponseStatus = new ResponseStatus();
25 | }
26 |
27 | [DataMember]
28 | public ArrayOfUser Users { get; set; }
29 |
30 | [DataMember]
31 | public ResponseStatus ResponseStatus { get; set; }
32 | }
33 | }
--------------------------------------------------------------------------------
/src/ServiceStack.Examples/ServiceStack.Examples.Clients.Silverlight/Types/IResponseStatus.cs:
--------------------------------------------------------------------------------
1 | namespace ServiceStack.Examples.ServiceInterface.Types
2 | {
3 | public interface IResponseStatus
4 | {
5 | }
6 | }
--------------------------------------------------------------------------------
/src/ServiceStack.Examples/ServiceStack.Examples.Clients.Silverlight/Types/ResponseStatus.cs:
--------------------------------------------------------------------------------
1 | using System.Runtime.Serialization;
2 | using ServiceStack.Service;
3 |
4 | namespace ServiceStack.Examples.ServiceInterface.Types
5 | {
6 | [DataContract]
7 | public class ResponseStatus : IResponseStatus
8 | {
9 | [DataMember]
10 | public string ErrorCode { get; set; }
11 |
12 | [DataMember]
13 | public string ErrorMessage { get; set; }
14 |
15 | [DataMember]
16 | public string StackTrace { get; set; }
17 |
18 | public bool IsSuccess { get { return ErrorCode == null; } }
19 | }
20 | }
--------------------------------------------------------------------------------
/src/ServiceStack.Examples/ServiceStack.Examples.Clients.Silverlight/Types/StoreNewUser.cs:
--------------------------------------------------------------------------------
1 | using System.Runtime.Serialization;
2 |
3 | namespace ServiceStack.Examples.ServiceInterface.Types
4 | {
5 | ///
6 | /// Use Plain old DataContract's Define your 'Service Interface'
7 | ///
8 | [DataContract]
9 | public class StoreNewUser
10 | {
11 | [DataMember]
12 | public string UserName { get; set; }
13 |
14 | [DataMember]
15 | public string Email { get; set; }
16 |
17 | [DataMember]
18 | public string Password { get; set; }
19 | }
20 |
21 | [DataContract]
22 | public class StoreNewUserResponse
23 | {
24 | public StoreNewUserResponse()
25 | {
26 | this.ResponseStatus = new ResponseStatus();
27 | }
28 |
29 | [DataMember]
30 | public long UserId { get; set; }
31 |
32 | [DataMember]
33 | public ResponseStatus ResponseStatus { get; set; }
34 | }
35 | }
--------------------------------------------------------------------------------
/src/ServiceStack.Examples/ServiceStack.Examples.Clients.Silverlight/Types/User.cs:
--------------------------------------------------------------------------------
1 | using System.Runtime.Serialization;
2 |
3 | namespace ServiceStack.Examples.ServiceInterface.Types
4 | {
5 | [DataContract]
6 | public class User
7 | {
8 | [DataMember]
9 | public long Id { get; set; }
10 |
11 | [DataMember]
12 | public string UserName { get; set; }
13 |
14 | [DataMember]
15 | public string Email { get; set; }
16 |
17 | [DataMember]
18 | public string Password { get; set; }
19 | }
20 | }
--------------------------------------------------------------------------------
/src/ServiceStack.Examples/ServiceStack.Examples.Clients.Silverlight/build/copy-types.bat:
--------------------------------------------------------------------------------
1 | COPY ..\..\ServiceStack.Examples.ServiceInterface\Types\* ..\Types\
--------------------------------------------------------------------------------
/src/ServiceStack.Examples/ServiceStack.Examples.Clients/ClientBin/ServiceStack.Examples.Clients.Silverlight.xap:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ServiceStack/ServiceStack.Examples/1319489d46665b98751dc09c0dc4a3e27f17e624/src/ServiceStack.Examples/ServiceStack.Examples.Clients/ClientBin/ServiceStack.Examples.Clients.Silverlight.xap
--------------------------------------------------------------------------------
/src/ServiceStack.Examples/ServiceStack.Examples.Clients/Default.aspx:
--------------------------------------------------------------------------------
1 | <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="ServiceStack.Examples.Clients.Default" %>
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
15 |
16 |
17 |
--------------------------------------------------------------------------------
/src/ServiceStack.Examples/ServiceStack.Examples.Clients/Default.aspx.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Web;
5 | using System.Web.UI;
6 | using System.Web.UI.WebControls;
7 |
8 | namespace ServiceStack.Examples.Clients
9 | {
10 | public partial class Default : System.Web.UI.Page
11 | {
12 | protected void Page_Load(object sender, EventArgs e)
13 | {
14 | Response.Redirect("Default.htm");
15 | }
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/src/ServiceStack.Examples/ServiceStack.Examples.Clients/Default.aspx.designer.cs:
--------------------------------------------------------------------------------
1 | //------------------------------------------------------------------------------
2 | //
3 | // This code was generated by a tool.
4 | // Runtime Version:2.0.50727.42
5 | //
6 | // Changes to this file may cause incorrect behavior and will be lost if
7 | // the code is regenerated.
8 | //
9 | //------------------------------------------------------------------------------
10 |
11 | namespace ServiceStack.Examples.Clients
12 | {
13 |
14 |
15 | public partial class Default
16 | {
17 |
18 | ///
19 | /// form1 control.
20 | ///
21 | ///
22 | /// Auto-generated field.
23 | /// To modify move field declaration from designer file to code-behind file.
24 | ///
25 | protected global::System.Web.UI.HtmlControls.HtmlForm form1;
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/src/ServiceStack.Examples/ServiceStack.Examples.Clients/Flash.htm:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | ServiceStack Examples :: Flash Client
5 |
6 |
7 |
8 |
9 |
10 |
11 |
16 |
17 | Coming Soon
18 |
19 |
24 |
25 |
26 |
27 |
--------------------------------------------------------------------------------
/src/ServiceStack.Examples/ServiceStack.Examples.Clients/clientaccesspolicy.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/src/ServiceStack.Examples/ServiceStack.Examples.Clients/crossdomain.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/src/ServiceStack.Examples/ServiceStack.Examples.Clients/img/Mono-powered-big.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ServiceStack/ServiceStack.Examples/1319489d46665b98751dc09c0dc4a3e27f17e624/src/ServiceStack.Examples/ServiceStack.Examples.Clients/img/Mono-powered-big.png
--------------------------------------------------------------------------------
/src/ServiceStack.Examples/ServiceStack.Examples.Clients/img/Tango-feet.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ServiceStack/ServiceStack.Examples/1319489d46665b98751dc09c0dc4a3e27f17e624/src/ServiceStack.Examples/ServiceStack.Examples.Clients/img/Tango-feet.png
--------------------------------------------------------------------------------
/src/ServiceStack.Examples/ServiceStack.Examples.Clients/img/bg-body-1024.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ServiceStack/ServiceStack.Examples/1319489d46665b98751dc09c0dc4a3e27f17e624/src/ServiceStack.Examples/ServiceStack.Examples.Clients/img/bg-body-1024.png
--------------------------------------------------------------------------------
/src/ServiceStack.Examples/ServiceStack.Examples.Clients/img/bg-body-large.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ServiceStack/ServiceStack.Examples/1319489d46665b98751dc09c0dc4a3e27f17e624/src/ServiceStack.Examples/ServiceStack.Examples.Clients/img/bg-body-large.png
--------------------------------------------------------------------------------
/src/ServiceStack.Examples/ServiceStack.Examples.Clients/img/demo-logo-servicestack.old.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ServiceStack/ServiceStack.Examples/1319489d46665b98751dc09c0dc4a3e27f17e624/src/ServiceStack.Examples/ServiceStack.Examples.Clients/img/demo-logo-servicestack.old.png
--------------------------------------------------------------------------------
/src/ServiceStack.Examples/ServiceStack.Examples.Clients/img/demo-logo-servicestack.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ServiceStack/ServiceStack.Examples/1319489d46665b98751dc09c0dc4a3e27f17e624/src/ServiceStack.Examples/ServiceStack.Examples.Clients/img/demo-logo-servicestack.png
--------------------------------------------------------------------------------
/src/ServiceStack.Examples/ServiceStack.Examples.Clients/img/small-logo-ajaxstack.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ServiceStack/ServiceStack.Examples/1319489d46665b98751dc09c0dc4a3e27f17e624/src/ServiceStack.Examples/ServiceStack.Examples.Clients/img/small-logo-ajaxstack.png
--------------------------------------------------------------------------------
/src/ServiceStack.Examples/ServiceStack.Examples.Clients/img/small-logo-servicestack.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ServiceStack/ServiceStack.Examples/1319489d46665b98751dc09c0dc4a3e27f17e624/src/ServiceStack.Examples/ServiceStack.Examples.Clients/img/small-logo-servicestack.png
--------------------------------------------------------------------------------
/src/ServiceStack.Examples/ServiceStack.Examples.Clients/img/tango-arrows.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ServiceStack/ServiceStack.Examples/1319489d46665b98751dc09c0dc4a3e27f17e624/src/ServiceStack.Examples/ServiceStack.Examples.Clients/img/tango-arrows.png
--------------------------------------------------------------------------------
/src/ServiceStack.Examples/ServiceStack.Examples.Clients/packages.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/src/ServiceStack.Examples/ServiceStack.Examples.Clients/sqlite3.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ServiceStack/ServiceStack.Examples/1319489d46665b98751dc09c0dc4a3e27f17e624/src/ServiceStack.Examples/ServiceStack.Examples.Clients/sqlite3.dll
--------------------------------------------------------------------------------
/src/ServiceStack.Examples/ServiceStack.Examples.Host.Console/App.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/src/ServiceStack.Examples/ServiceStack.Examples.Host.Console/Program.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Text;
3 | using System.Threading;
4 |
5 | namespace ServiceStack.Examples.Host.Console
6 | {
7 | class Program
8 | {
9 | private const string ListeningOn = "http://localhost:82/";
10 |
11 | static void Main(string[] args)
12 | {
13 | var appHost = new AppHost();
14 | appHost.Init();
15 | appHost.Start(ListeningOn);
16 |
17 | System.Console.WriteLine("AppHost Created at {0}, listening on {1}",
18 | DateTime.Now, ListeningOn);
19 |
20 | var sb = new StringBuilder();
21 | sb.AppendLine("Some urls for you to try:\n");
22 | sb.AppendLine(ListeningOn + "xml/syncreply/GetFactorial?ForNumber=5");
23 | sb.AppendLine(ListeningOn + "json/syncreply/GetFibonacciNumbers?Skip=5&Take=10");
24 | sb.AppendLine(ListeningOn + "jsv/syncreply/GetAllUsers?debug");
25 |
26 | System.Console.WriteLine(sb);
27 |
28 |
29 | Thread.Sleep(Timeout.Infinite);
30 | System.Console.WriteLine("ReadLine()");
31 | System.Console.ReadLine();
32 | }
33 | }
34 | }
35 |
--------------------------------------------------------------------------------
/src/ServiceStack.Examples/ServiceStack.Examples.Host.Console/packages.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/src/ServiceStack.Examples/ServiceStack.Examples.Host.Console/sqlite3.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ServiceStack/ServiceStack.Examples/1319489d46665b98751dc09c0dc4a3e27f17e624/src/ServiceStack.Examples/ServiceStack.Examples.Host.Console/sqlite3.dll
--------------------------------------------------------------------------------
/src/ServiceStack.Examples/ServiceStack.Examples.Host.Web/Default.aspx:
--------------------------------------------------------------------------------
1 | <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="ServiceStack.Examples.Host.Web._Default" %>
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
15 |
16 |
17 |
--------------------------------------------------------------------------------
/src/ServiceStack.Examples/ServiceStack.Examples.Host.Web/Default.aspx.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Web;
5 | using System.Web.UI;
6 | using System.Web.UI.WebControls;
7 |
8 | namespace ServiceStack.Examples.Host.Web
9 | {
10 | public partial class _Default : System.Web.UI.Page
11 | {
12 | protected void Page_Load(object sender, EventArgs e)
13 | {
14 | Response.Redirect("ServiceStack/Metadata");
15 | }
16 | }
17 | }
--------------------------------------------------------------------------------
/src/ServiceStack.Examples/ServiceStack.Examples.Host.Web/Default.aspx.designer.cs:
--------------------------------------------------------------------------------
1 | //------------------------------------------------------------------------------
2 | //
3 | // This code was generated by a tool.
4 | // Runtime Version:2.0.50727.4918
5 | //
6 | // Changes to this file may cause incorrect behavior and will be lost if
7 | // the code is regenerated.
8 | //
9 | //------------------------------------------------------------------------------
10 |
11 | namespace ServiceStack.Examples.Host.Web
12 | {
13 | public partial class _Default {
14 |
15 | ///
16 | /// form1 control.
17 | ///
18 | ///
19 | /// Auto-generated field.
20 | /// To modify move field declaration from designer file to code-behind file.
21 | ///
22 | protected global::System.Web.UI.HtmlControls.HtmlForm form1;
23 | }
24 | }
--------------------------------------------------------------------------------
/src/ServiceStack.Examples/ServiceStack.Examples.Host.Web/Global.asax:
--------------------------------------------------------------------------------
1 | <%@ Application Codebehind="Global.asax.cs" Inherits="ServiceStack.Examples.Host.Web.Global" Language="C#" %>
2 |
--------------------------------------------------------------------------------
/src/ServiceStack.Examples/ServiceStack.Examples.Host.Web/Global.asax.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Configuration;
3 | using System.IO;
4 | using ServiceStack.Configuration;
5 |
6 | namespace ServiceStack.Examples.Host.Web
7 | {
8 | public class Global : System.Web.HttpApplication
9 | {
10 |
11 | protected void Application_Start(object sender, EventArgs e)
12 | {
13 | if (File.Exists(@"C:\src\appsettings.license.txt"))
14 | Licensing.RegisterLicenseFromFile(@"C:\src\appsettings.license.txt");
15 | else if (string.IsNullOrEmpty(ConfigUtils.GetNullableAppSetting("servicestack:license")))
16 | throw new ConfigurationErrorsException("A valid license key is required for this demo");
17 |
18 | var appHost = new AppHost();
19 | appHost.Init();
20 | }
21 |
22 | protected void Session_Start(object sender, EventArgs e)
23 | {
24 |
25 | }
26 |
27 | protected void Application_BeginRequest(object sender, EventArgs e)
28 | {
29 |
30 | }
31 |
32 | protected void Application_AuthenticateRequest(object sender, EventArgs e)
33 | {
34 |
35 | }
36 |
37 | protected void Application_Error(object sender, EventArgs e)
38 | {
39 |
40 | }
41 |
42 | protected void Session_End(object sender, EventArgs e)
43 | {
44 |
45 | }
46 |
47 | protected void Application_End(object sender, EventArgs e)
48 | {
49 | }
50 | }
51 | }
--------------------------------------------------------------------------------
/src/ServiceStack.Examples/ServiceStack.Examples.Host.Web/clientaccesspolicy.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/src/ServiceStack.Examples/ServiceStack.Examples.Host.Web/crossdomain.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/src/ServiceStack.Examples/ServiceStack.Examples.Host.Web/packages.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/src/ServiceStack.Examples/ServiceStack.Examples.Host.Web/sqlite3.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ServiceStack/ServiceStack.Examples/1319489d46665b98751dc09c0dc4a3e27f17e624/src/ServiceStack.Examples/ServiceStack.Examples.Host.Web/sqlite3.dll
--------------------------------------------------------------------------------
/src/ServiceStack.Examples/ServiceStack.Examples.ServiceInterface/DeleteAllUsersService.cs:
--------------------------------------------------------------------------------
1 | using ServiceStack.Examples.ServiceModel;
2 | using ServiceStack.Examples.ServiceModel.Types;
3 | using ServiceStack.OrmLite;
4 |
5 | namespace ServiceStack.Examples.ServiceInterface
6 | {
7 | ///
8 | /// The service or 'Port' handler that will be used to execute the request.
9 | ///
10 | /// The 'Port' attribute is used to link the 'service request' to the 'service implementation'
11 | ///
12 | public class DeleteAllUsersService : Service
13 | {
14 | public object Any(DeleteAllUsers request)
15 | {
16 | Db.DeleteAll();
17 |
18 | return new DeleteAllUsersResponse();
19 | }
20 | }
21 | }
--------------------------------------------------------------------------------
/src/ServiceStack.Examples/ServiceStack.Examples.ServiceInterface/ExampleConfig.cs:
--------------------------------------------------------------------------------
1 | using ServiceStack.Configuration;
2 |
3 | namespace ServiceStack.Examples.ServiceInterface
4 | {
5 | public class ExampleConfig
6 | {
7 | ///
8 | /// Would've preferred to use [assembly: ContractNamespace] attribute but it is not supported in Mono
9 | ///
10 | public const string DefaultNamespace = "http://schemas.servicestack.net/types";
11 |
12 | public ExampleConfig() { }
13 |
14 | public ExampleConfig(IAppSettings appConfig)
15 | {
16 | ConnectionString = appConfig.GetString("ConnectionString");
17 | DefaultFibonacciLimit = appConfig.Get("DefaultFibonacciLimit", 10);
18 | }
19 |
20 | public string ConnectionString { get; set; }
21 | public int DefaultFibonacciLimit { get; set; }
22 |
23 | }
24 | }
--------------------------------------------------------------------------------
/src/ServiceStack.Examples/ServiceStack.Examples.ServiceInterface/GetAllUsersService.cs:
--------------------------------------------------------------------------------
1 | using ServiceStack.Examples.ServiceModel;
2 | using ServiceStack.Examples.ServiceModel.Types;
3 | using ServiceStack.OrmLite;
4 |
5 | namespace ServiceStack.Examples.ServiceInterface
6 | {
7 | public class GetAllUsersService : Service
8 | {
9 | public object Any(GetAllUsers request)
10 | {
11 | var users = Db.Select();
12 | return new GetAllUsersResponse { Users = new ArrayOfUser(users) };
13 | }
14 | }
15 |
16 | }
--------------------------------------------------------------------------------
/src/ServiceStack.Examples/ServiceStack.Examples.ServiceInterface/GetFactorialService.cs:
--------------------------------------------------------------------------------
1 | using ServiceStack.Examples.ServiceModel;
2 |
3 | namespace ServiceStack.Examples.ServiceInterface
4 | {
5 | ///
6 | /// The purpose of this example is to show the minimum number and detail of classes
7 | /// required in order to implement a simple service.
8 | ///
9 | public class GetFactorialService : Service
10 | {
11 | public GetFactorialResponse Any(GetFactorial request)
12 | {
13 | return new GetFactorialResponse { Result = GetFactorial(request.ForNumber) };
14 | }
15 |
16 | static long GetFactorial(long n)
17 | {
18 | return n > 1 ? n * GetFactorial(n - 1) : 1;
19 | }
20 | }
21 | }
--------------------------------------------------------------------------------
/src/ServiceStack.Examples/ServiceStack.Examples.ServiceInterface/GetUsersService.cs:
--------------------------------------------------------------------------------
1 | using System.Collections.Generic;
2 | using ServiceStack.Examples.ServiceModel;
3 | using ServiceStack.Examples.ServiceModel.Types;
4 | using ServiceStack.OrmLite;
5 |
6 | namespace ServiceStack.Examples.ServiceInterface
7 | {
8 | ///
9 | /// The service handler that will be used to execute the request.
10 | ///
11 | /// This example shows a simple introduction into SOA-like webservices.
12 | /// i.e. group similar operations into a single 'document-centric like' service request.
13 | ///
14 | public class GetUsersService : Service
15 | {
16 | public GetUsersResponse Any(GetUsers request)
17 | {
18 | var users = new List();
19 |
20 | if (request.UserIds != null && request.UserIds.Count > 0)
21 | {
22 | users.AddRange(Db.SelectByIds(request.UserIds));
23 | }
24 |
25 | if (request.UserNames != null && request.UserNames.Count > 0)
26 | {
27 | users.AddRange(Db.Select(q => request.UserNames.Contains(q.UserName)));
28 | }
29 |
30 | return new GetUsersResponse { Users = new ArrayOfUser(users) };
31 | }
32 | }
33 | }
--------------------------------------------------------------------------------
/src/ServiceStack.Examples/ServiceStack.Examples.ServiceInterface/GreetService.cs:
--------------------------------------------------------------------------------
1 | using ServiceStack.Examples.ServiceModel;
2 |
3 | namespace ServiceStack.Examples.ServiceInterface
4 | {
5 | ///
6 | /// An example of a very basic web service
7 | ///
8 | public class GreetService : Service
9 | {
10 | public object Any(Greet request)
11 | {
12 | return new GreetResponse { Result = "Hello " + request.Name };
13 | }
14 | }
15 | }
--------------------------------------------------------------------------------
/src/ServiceStack.Examples/ServiceStack.Examples.ServiceInterface/ResetMovieDatabaseService.cs:
--------------------------------------------------------------------------------
1 | using ServiceStack.Data;
2 | using ServiceStack.Examples.ServiceInterface.Support;
3 | using ServiceStack.Examples.ServiceModel;
4 | using ServiceStack.Examples.ServiceModel.Types;
5 | using ServiceStack.OrmLite;
6 |
7 | namespace ServiceStack.Examples.ServiceInterface
8 | {
9 | ///
10 | /// An example of a very basic web service
11 | ///
12 | public class ResetMovieDatabaseService : Service
13 | {
14 | public IDbConnectionFactory ConnectionFactory { get; set; }
15 |
16 | public object Any(ResetMovieDatabase request)
17 | {
18 | Db.CreateTable(true);
19 | Db.SaveAll(ConfigureDatabase.Top5Movies);
20 |
21 | return new ResetMovieDatabaseResponse();
22 | }
23 | }
24 | }
--------------------------------------------------------------------------------
/src/ServiceStack.Examples/ServiceStack.Examples.ServiceInterface/StoreLogsService.cs:
--------------------------------------------------------------------------------
1 | using ServiceStack.Examples.ServiceModel;
2 | using ServiceStack.Examples.ServiceModel.Types;
3 | using ServiceStack.OrmLite;
4 |
5 | namespace ServiceStack.Examples.ServiceInterface
6 | {
7 | public class StoreLogsService : Service
8 | {
9 | public object Any(StoreLogs request)
10 | {
11 | if (!request.Loggers.IsNullOrEmpty()) { Db.SaveAll(request.Loggers); }
12 |
13 | return new StoreLogsResponse
14 | {
15 | ExistingLogs = new ArrayOfLogger(Db.Select())
16 | };
17 | }
18 | }
19 | }
--------------------------------------------------------------------------------
/src/ServiceStack.Examples/ServiceStack.Examples.ServiceInterface/packages.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/src/ServiceStack.Examples/ServiceStack.Examples.ServiceModel/DeleteAllUsers.cs:
--------------------------------------------------------------------------------
1 | using System.Runtime.Serialization;
2 |
3 | namespace ServiceStack.Examples.ServiceModel
4 | {
5 | ///
6 | /// Use Plain old DataContract's Define your 'Service Interface'
7 | ///
8 | [DataContract(Namespace = ExampleConfig.DefaultNamespace)]
9 | public class DeleteAllUsers
10 | {
11 | }
12 |
13 | [DataContract(Namespace = ExampleConfig.DefaultNamespace)]
14 | public class DeleteAllUsersResponse
15 | {
16 | public DeleteAllUsersResponse()
17 | {
18 | this.ResponseStatus = new ResponseStatus();
19 | }
20 |
21 | [DataMember]
22 | public long UserId { get; set; }
23 |
24 | [DataMember]
25 | public ResponseStatus ResponseStatus { get; set; }
26 | }
27 | }
--------------------------------------------------------------------------------
/src/ServiceStack.Examples/ServiceStack.Examples.ServiceModel/ExampleConfig.cs:
--------------------------------------------------------------------------------
1 | using ServiceStack.Configuration;
2 |
3 | namespace ServiceStack.Examples.ServiceModel
4 | {
5 | public class ExampleConfig
6 | {
7 | ///
8 | /// Would've preferred to use [assembly: ContractNamespace] attribute but it is not supported in Mono
9 | ///
10 | public const string DefaultNamespace = "http://schemas.servicestack.net/types";
11 |
12 | public ExampleConfig() { }
13 |
14 | public ExampleConfig(IAppSettings appConfig)
15 | {
16 | ConnectionString = appConfig.GetString("ConnectionString");
17 | DefaultFibonacciLimit = appConfig.Get("DefaultFibonacciLimit", 10);
18 | }
19 |
20 | public string ConnectionString { get; set; }
21 | public int DefaultFibonacciLimit { get; set; }
22 | }
23 | }
--------------------------------------------------------------------------------
/src/ServiceStack.Examples/ServiceStack.Examples.ServiceModel/GetAllUsers.cs:
--------------------------------------------------------------------------------
1 | using System.Runtime.Serialization;
2 | using ServiceStack.Examples.ServiceModel.Types;
3 |
4 | namespace ServiceStack.Examples.ServiceModel
5 | {
6 | ///
7 | /// Use Plain old DataContract's Define your 'Service Interface'
8 | ///
9 | /// This example shows a simple introduction into SOA-like webservices.
10 | /// i.e. group similar operations into a single 'document-centric like' service request.
11 | ///
12 | [DataContract(Namespace = ExampleConfig.DefaultNamespace)]
13 | public class GetAllUsers { }
14 |
15 | [DataContract(Namespace = ExampleConfig.DefaultNamespace)]
16 | public class GetAllUsersResponse
17 | {
18 | public GetAllUsersResponse()
19 | {
20 | this.ResponseStatus = new ResponseStatus();
21 | }
22 |
23 | [DataMember]
24 | public ArrayOfUser Users { get; set; }
25 |
26 | [DataMember]
27 | public ResponseStatus ResponseStatus { get; set; }
28 | }
29 | }
--------------------------------------------------------------------------------
/src/ServiceStack.Examples/ServiceStack.Examples.ServiceModel/GetFactorial.cs:
--------------------------------------------------------------------------------
1 | using System.Runtime.Serialization;
2 |
3 | namespace ServiceStack.Examples.ServiceModel
4 | {
5 | ///
6 | /// Use Plain old DataContract's Define your 'Service Interface'.
7 | ///
8 | /// The purpose of this example is to show the minimum number and detail of classes
9 | /// required in order to implement a simple service.
10 | ///
11 | [DataContract(Namespace = ExampleConfig.DefaultNamespace)]
12 | public class GetFactorial
13 | {
14 | [DataMember]
15 | public long ForNumber { get; set; }
16 | }
17 |
18 | [DataContract(Namespace = ExampleConfig.DefaultNamespace)]
19 | public class GetFactorialResponse
20 | {
21 | [DataMember]
22 | public long Result { get; set; }
23 | }
24 | }
--------------------------------------------------------------------------------
/src/ServiceStack.Examples/ServiceStack.Examples.ServiceModel/GetFibonacciNumbers.cs:
--------------------------------------------------------------------------------
1 | using System.Runtime.Serialization;
2 |
3 | namespace ServiceStack.Examples.ServiceModel
4 | {
5 | ///
6 | /// Use Plain old DataContract's Define your 'Service Interface'
7 | ///
8 | /// This purpose of this example is how you would implement a more advanced
9 | /// web service returning a slightly more 'complex object'.
10 | ///
11 | [DataContract(Namespace = ExampleConfig.DefaultNamespace)]
12 | public class GetFibonacciNumbers
13 | {
14 | [DataMember]
15 | public long? Skip { get; set; }
16 |
17 | [DataMember]
18 | public long? Take { get; set; }
19 | }
20 |
21 | [DataContract(Namespace = ExampleConfig.DefaultNamespace)]
22 | public class GetFibonacciNumbersResponse
23 | {
24 | [DataMember]
25 | public ArrayOfLong Results { get; set; }
26 | }
27 | }
--------------------------------------------------------------------------------
/src/ServiceStack.Examples/ServiceStack.Examples.ServiceModel/GetNorthwindCustomerOrders.cs:
--------------------------------------------------------------------------------
1 | using System.Runtime.Serialization;
2 | using ServiceStack.Examples.ServiceModel.Types;
3 |
4 | namespace ServiceStack.Examples.ServiceModel
5 | {
6 | [DataContract(Namespace = ExampleConfig.DefaultNamespace)]
7 | public class GetNorthwindCustomerOrders
8 | {
9 | [DataMember]
10 | public string CustomerId { get; set; }
11 | }
12 |
13 | [DataContract(Namespace = ExampleConfig.DefaultNamespace)]
14 | public class GetNorthwindCustomerOrdersResponse
15 | {
16 | public GetNorthwindCustomerOrdersResponse()
17 | {
18 | this.ResponseStatus = new ResponseStatus();
19 | }
20 |
21 | [DataMember]
22 | public CustomerOrders CustomerOrders { get; set; }
23 |
24 | [DataMember]
25 | public ResponseStatus ResponseStatus { get; set; }
26 | }
27 | }
--------------------------------------------------------------------------------
/src/ServiceStack.Examples/ServiceStack.Examples.ServiceModel/GetNorthwindCustomerOrdersCached.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Runtime.Serialization;
3 | using ServiceStack.Examples.ServiceModel.Types;
4 |
5 | namespace ServiceStack.Examples.ServiceModel
6 | {
7 | [DataContract(Namespace = ExampleConfig.DefaultNamespace)]
8 | public class GetNorthwindCustomerOrdersCached
9 | {
10 | [DataMember]
11 | public bool RefreshCache { get; set; }
12 |
13 | [DataMember]
14 | public string CustomerId { get; set; }
15 | }
16 |
17 | [DataContract(Namespace = ExampleConfig.DefaultNamespace)]
18 | public class GetNorthwindCustomerOrdersCachedResponse
19 | {
20 | public GetNorthwindCustomerOrdersCachedResponse()
21 | {
22 | this.ResponseStatus = new ResponseStatus();
23 | }
24 |
25 | [DataMember]
26 | public DateTime CreatedDate { get; set; }
27 |
28 | [DataMember]
29 | public CustomerOrders CustomerOrders { get; set; }
30 |
31 | [DataMember]
32 | public ResponseStatus ResponseStatus { get; set; }
33 | }
34 | }
--------------------------------------------------------------------------------
/src/ServiceStack.Examples/ServiceStack.Examples.ServiceModel/GetUsers.cs:
--------------------------------------------------------------------------------
1 | using System.Collections.Generic;
2 | using System.Runtime.Serialization;
3 | using ServiceStack.Examples.ServiceModel.Types;
4 |
5 | namespace ServiceStack.Examples.ServiceModel
6 | {
7 | ///
8 | /// Use Plain old DataContract's Define your 'Service Interface'
9 | ///
10 | /// This example shows the flavour of SOA-style webservices.
11 | /// i.e. group similar operations into a single batch-full service request.
12 | ///
13 | [DataContract(Namespace = ExampleConfig.DefaultNamespace)]
14 | public class GetUsers
15 | {
16 | [DataMember]
17 | public List UserIds { get; set; }
18 |
19 | [DataMember]
20 | public List UserNames { get; set; }
21 | }
22 |
23 | [DataContract(Namespace = ExampleConfig.DefaultNamespace)]
24 | public class GetUsersResponse
25 | {
26 | public GetUsersResponse()
27 | {
28 | this.ResponseStatus = new ResponseStatus();
29 | }
30 |
31 | [DataMember]
32 | public ArrayOfUser Users { get; set; }
33 |
34 | [DataMember]
35 | public ResponseStatus ResponseStatus { get; set; }
36 | }
37 | }
--------------------------------------------------------------------------------
/src/ServiceStack.Examples/ServiceStack.Examples.ServiceModel/Greet.cs:
--------------------------------------------------------------------------------
1 | using System.Runtime.Serialization;
2 |
3 | namespace ServiceStack.Examples.ServiceModel
4 | {
5 | [DataContract(Namespace = ExampleConfig.DefaultNamespace)]
6 | public class Greet
7 | {
8 | [DataMember]
9 | public string Name { get; set; }
10 | }
11 |
12 | [DataContract(Namespace = ExampleConfig.DefaultNamespace)]
13 | public class GreetResponse
14 | {
15 | [DataMember]
16 | public string Result { get; set; }
17 | }
18 | }
--------------------------------------------------------------------------------
/src/ServiceStack.Examples/ServiceStack.Examples.ServiceModel/Movies.cs:
--------------------------------------------------------------------------------
1 | using System.Collections.Generic;
2 | using System.Runtime.Serialization;
3 | using ServiceStack.Examples.ServiceModel.Types;
4 |
5 | namespace ServiceStack.Examples.ServiceModel
6 | {
7 | [DataContract(Namespace = ExampleConfig.DefaultNamespace)]
8 | public class Movies
9 | {
10 | [DataMember]
11 | public string Id { get; set; }
12 |
13 | [DataMember]
14 | public Movie Movie { get; set; }
15 | }
16 |
17 | [DataContract(Namespace = ExampleConfig.DefaultNamespace)]
18 | public class MoviesResponse
19 | {
20 | public MoviesResponse()
21 | {
22 | this.ResponseStatus = new ResponseStatus();
23 | this.Movies = new List();
24 | }
25 |
26 | [DataMember]
27 | public ResponseStatus ResponseStatus { get; set; }
28 |
29 | [DataMember]
30 | public List Movies { get; set; }
31 | }
32 | }
--------------------------------------------------------------------------------
/src/ServiceStack.Examples/ServiceStack.Examples.ServiceModel/ResetMovieDatabase.cs:
--------------------------------------------------------------------------------
1 | using System.Runtime.Serialization;
2 |
3 | namespace ServiceStack.Examples.ServiceModel
4 | {
5 | [DataContract(Namespace = ExampleConfig.DefaultNamespace)]
6 | public class ResetMovieDatabase
7 | {
8 | }
9 |
10 | [DataContract(Namespace = ExampleConfig.DefaultNamespace)]
11 | public class ResetMovieDatabaseResponse
12 | {
13 | public ResetMovieDatabaseResponse()
14 | {
15 | this.ResponseStatus = new ResponseStatus();
16 | }
17 |
18 | [DataMember]
19 | public ResponseStatus ResponseStatus { get; set; }
20 | }
21 | }
--------------------------------------------------------------------------------
/src/ServiceStack.Examples/ServiceStack.Examples.ServiceModel/StoreLogs.cs:
--------------------------------------------------------------------------------
1 | using System.Runtime.Serialization;
2 | using ServiceStack.Examples.ServiceModel.Types;
3 |
4 | namespace ServiceStack.Examples.ServiceModel
5 | {
6 | [DataContract(Namespace = ExampleConfig.DefaultNamespace)]
7 | public class StoreLogs
8 | {
9 | [DataMember]
10 | public ArrayOfLogger Loggers { get; set; }
11 | }
12 |
13 | [DataContract(Namespace = ExampleConfig.DefaultNamespace)]
14 | public class StoreLogsResponse
15 | {
16 | public StoreLogsResponse()
17 | {
18 | this.ResponseStatus = new ResponseStatus();
19 |
20 | this.ExistingLogs = new ArrayOfLogger();
21 | }
22 |
23 | [DataMember]
24 | public ArrayOfLogger ExistingLogs { get; set; }
25 |
26 | [DataMember]
27 | public ResponseStatus ResponseStatus { get; set; }
28 | }
29 | }
--------------------------------------------------------------------------------
/src/ServiceStack.Examples/ServiceStack.Examples.ServiceModel/StoreNewUser.cs:
--------------------------------------------------------------------------------
1 | using System.Runtime.Serialization;
2 |
3 | namespace ServiceStack.Examples.ServiceModel
4 | {
5 | ///
6 | /// Use Plain old DataContract's Define your 'Service Interface'
7 | ///
8 | /// This example introduces the concept of a generic 'ResponseStatus' that
9 | /// your service client can use to assert that the request was successful.
10 | /// The ResponseStatus DTO also enables you to serialize an exception in your service.
11 | ///
12 | [DataContract(Namespace = ExampleConfig.DefaultNamespace)]
13 | public class StoreNewUser
14 | {
15 | [DataMember]
16 | public string UserName { get; set; }
17 |
18 | [DataMember]
19 | public string Email { get; set; }
20 |
21 | [DataMember]
22 | public string Password { get; set; }
23 | }
24 |
25 | [DataContract(Namespace = ExampleConfig.DefaultNamespace)]
26 | public class StoreNewUserResponse
27 | {
28 | public StoreNewUserResponse()
29 | {
30 | this.ResponseStatus = new ResponseStatus();
31 | }
32 |
33 | [DataMember]
34 | public long UserId { get; set; }
35 |
36 | [DataMember]
37 | public ResponseStatus ResponseStatus { get; set; }
38 | }
39 | }
--------------------------------------------------------------------------------
/src/ServiceStack.Examples/ServiceStack.Examples.ServiceModel/Types/ArrayOfUser.cs:
--------------------------------------------------------------------------------
1 | using System.Collections.Generic;
2 | using System.Runtime.Serialization;
3 |
4 | namespace ServiceStack.Examples.ServiceModel.Types
5 | {
6 | [CollectionDataContract(Namespace = ExampleConfig.DefaultNamespace, ItemName = "User")]
7 | public class ArrayOfUser : List
8 | {
9 | public ArrayOfUser() { }
10 | public ArrayOfUser(IEnumerable collection) : base(collection) { }
11 | }
12 | }
--------------------------------------------------------------------------------
/src/ServiceStack.Examples/ServiceStack.Examples.ServiceModel/Types/User.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Runtime.Serialization;
3 | using ServiceStack.DataAnnotations;
4 |
5 | namespace ServiceStack.Examples.ServiceModel.Types
6 | {
7 | [DataContract(Namespace = ExampleConfig.DefaultNamespace)]
8 | public class User
9 | {
10 | [AutoIncrement]
11 | [DataMember]
12 | public int Id { get; set; }
13 |
14 | [DataMember]
15 | public string UserName { get; set; }
16 |
17 | [DataMember]
18 | public string Email { get; set; }
19 |
20 | [DataMember]
21 | public string Password { get; set; }
22 |
23 | [DataMember]
24 | public Guid GlobalId { get; set; }
25 | }
26 | }
--------------------------------------------------------------------------------
/src/ServiceStack.Examples/ServiceStack.Examples.ServiceModel/packages.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/src/ServiceStack.Examples/ServiceStack.Examples.gpState:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/src/ServiceStack.Hello/Content/Images/MetadataIndex.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ServiceStack/ServiceStack.Examples/1319489d46665b98751dc09c0dc4a3e27f17e624/src/ServiceStack.Hello/Content/Images/MetadataIndex.png
--------------------------------------------------------------------------------
/src/ServiceStack.Hello/Content/Images/Mono-powered-big.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ServiceStack/ServiceStack.Examples/1319489d46665b98751dc09c0dc4a3e27f17e624/src/ServiceStack.Hello/Content/Images/Mono-powered-big.png
--------------------------------------------------------------------------------
/src/ServiceStack.Hello/Content/Images/NewProject.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ServiceStack/ServiceStack.Examples/1319489d46665b98751dc09c0dc4a3e27f17e624/src/ServiceStack.Hello/Content/Images/NewProject.png
--------------------------------------------------------------------------------
/src/ServiceStack.Hello/Content/Images/bg-body-1024.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ServiceStack/ServiceStack.Examples/1319489d46665b98751dc09c0dc4a3e27f17e624/src/ServiceStack.Hello/Content/Images/bg-body-1024.png
--------------------------------------------------------------------------------
/src/ServiceStack.Hello/Content/Images/btn-github.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ServiceStack/ServiceStack.Examples/1319489d46665b98751dc09c0dc4a3e27f17e624/src/ServiceStack.Hello/Content/Images/btn-github.png
--------------------------------------------------------------------------------
/src/ServiceStack.Hello/Global.asax:
--------------------------------------------------------------------------------
1 | <%@ Application Codebehind="Global.asax.cs" Inherits="ServiceStack.Hello.Global" Language="C#" %>
2 |
--------------------------------------------------------------------------------
/src/ServiceStack.Hello/ServiceStack.Hello.csproj.user:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | ProjectFiles
5 | false
6 |
7 |
8 |
9 |
10 |
11 | default.htm
12 | SpecificPage
13 | True
14 | False
15 | False
16 | False
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 | False
26 | True
27 |
28 |
29 |
30 |
31 |
--------------------------------------------------------------------------------
/src/ServiceStack.Hello/ServiceStack.Hello.sln:
--------------------------------------------------------------------------------
1 |
2 | Microsoft Visual Studio Solution File, Format Version 11.00
3 | # Visual Studio 2010
4 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ServiceStack.Hello", "ServiceStack.Hello.csproj", "{A8F9A08B-E704-4C77-939B-B56670A2A98D}"
5 | EndProject
6 | Global
7 | GlobalSection(SolutionConfigurationPlatforms) = preSolution
8 | Debug|Any CPU = Debug|Any CPU
9 | Release|Any CPU = Release|Any CPU
10 | EndGlobalSection
11 | GlobalSection(ProjectConfigurationPlatforms) = postSolution
12 | {A8F9A08B-E704-4C77-939B-B56670A2A98D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
13 | {A8F9A08B-E704-4C77-939B-B56670A2A98D}.Debug|Any CPU.Build.0 = Debug|Any CPU
14 | {A8F9A08B-E704-4C77-939B-B56670A2A98D}.Release|Any CPU.ActiveCfg = Release|Any CPU
15 | {A8F9A08B-E704-4C77-939B-B56670A2A98D}.Release|Any CPU.Build.0 = Release|Any CPU
16 | EndGlobalSection
17 | GlobalSection(SolutionProperties) = preSolution
18 | HideSolutionNode = FALSE
19 | EndGlobalSection
20 | EndGlobal
21 |
--------------------------------------------------------------------------------
/src/ServiceStack.Hello/packages.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/src/ServiceStack.MovieRest/Web/App_Start/AppHost.cs:
--------------------------------------------------------------------------------
1 |
2 | namespace ServiceStack.MovieRest.App_Start
3 | {
4 | using Funq;
5 | using OrmLite;
6 | using Text;
7 | using Data;
8 |
9 | public class AppHost
10 | : AppHostBase
11 | {
12 | ///
13 | /// Initializes a new instance of your ServiceStack application, with the specified name and assembly containing the services.
14 | ///
15 | public AppHost() : base("ServiceStack REST at the Movies!", typeof (MovieService).Assembly) {}
16 |
17 | public override void Configure(Container container)
18 | {
19 | JsConfig.DateHandler = DateHandler.ISO8601;
20 |
21 | //Set JSON web services to return idiomatic JSON camelCase properties
22 | JsConfig.EmitCamelCaseNames = true;
23 |
24 | container.Register(
25 | c => new OrmLiteConnectionFactory("~/App_Data/db.sqlite".MapHostAbsolutePath(), SqliteDialect.Provider));
26 |
27 | using (var resetMovies = container.Resolve())
28 | {
29 | resetMovies.Any(null);
30 | }
31 |
32 | Plugins.Add(new CorsFeature()); //Enable CORS
33 |
34 | SetConfig(new HostConfig {
35 | DebugMode = true //Show StackTraces for easier debugging (default auto inferred by Debug/Release builds)
36 | });
37 | }
38 | }
39 | }
--------------------------------------------------------------------------------
/src/ServiceStack.MovieRest/Web/Content/Images/bg-body-1024.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ServiceStack/ServiceStack.Examples/1319489d46665b98751dc09c0dc4a3e27f17e624/src/ServiceStack.MovieRest/Web/Content/Images/bg-body-1024.png
--------------------------------------------------------------------------------
/src/ServiceStack.MovieRest/Web/Content/Images/btn-github.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ServiceStack/ServiceStack.Examples/1319489d46665b98751dc09c0dc4a3e27f17e624/src/ServiceStack.MovieRest/Web/Content/Images/btn-github.png
--------------------------------------------------------------------------------
/src/ServiceStack.MovieRest/Web/Global.asax:
--------------------------------------------------------------------------------
1 | <%@ Application Codebehind="Global.asax.cs" Inherits="ServiceStack.MovieRest.Global" Language="C#" %>
2 |
--------------------------------------------------------------------------------
/src/ServiceStack.MovieRest/Web/Global.asax.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using ServiceStack.MovieRest.App_Start;
3 |
4 | namespace ServiceStack.MovieRest
5 | {
6 | using System.Web;
7 |
8 | public class Global : HttpApplication
9 | {
10 | protected void Application_Start(object sender, EventArgs e)
11 | {
12 | //Initialize your application
13 | (new AppHost()).Init();
14 | }
15 | }
16 | }
--------------------------------------------------------------------------------
/src/ServiceStack.MovieRest/Web/packages.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/src/ServiceStack.MovieRest/Web/sqlite3.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ServiceStack/ServiceStack.Examples/1319489d46665b98751dc09c0dc4a3e27f17e624/src/ServiceStack.MovieRest/Web/sqlite3.dll
--------------------------------------------------------------------------------
/src/ServiceStack.Northwind/.nuget/NuGet.Config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/src/ServiceStack.Northwind/.nuget/NuGet.exe:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ServiceStack/ServiceStack.Examples/1319489d46665b98751dc09c0dc4a3e27f17e624/src/ServiceStack.Northwind/.nuget/NuGet.exe
--------------------------------------------------------------------------------
/src/ServiceStack.Northwind/ServiceStack.Northwind.ServiceInterface/CustomerDetailsService.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Net;
3 | using ServiceStack.Northwind.ServiceModel.Operations;
4 | using ServiceStack.Northwind.ServiceModel.Types;
5 |
6 | using ServiceStack.OrmLite;
7 |
8 | namespace ServiceStack.Northwind.ServiceInterface
9 | {
10 | public class CustomerDetailsService : Service
11 | {
12 | public CustomerDetailsResponse Get(CustomerDetails request)
13 | {
14 | var customer = Db.SingleById(request.Id);
15 | if (customer == null)
16 | throw new HttpError(HttpStatusCode.NotFound,
17 | new ArgumentException("Customer does not exist: " + request.Id));
18 |
19 | var ordersService = base.ResolveService();
20 | var ordersResponse = (OrdersResponse) ordersService.Get(new Orders {CustomerId = customer.Id});
21 |
22 | return new CustomerDetailsResponse
23 | {
24 | Customer = customer,
25 | CustomerOrders = ordersResponse.Results,
26 | };
27 | }
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/src/ServiceStack.Northwind/ServiceStack.Northwind.ServiceInterface/CustomersService.cs:
--------------------------------------------------------------------------------
1 | using ServiceStack.Northwind.ServiceModel.Operations;
2 | using ServiceStack.Northwind.ServiceModel.Types;
3 | using ServiceStack.OrmLite;
4 |
5 | namespace ServiceStack.Northwind.ServiceInterface
6 | {
7 | public class CustomersService : ServiceStack.Service
8 | {
9 | public CustomersResponse Get(Customers request)
10 | {
11 | return new CustomersResponse { Customers = Db.Select() };
12 | }
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/src/ServiceStack.Northwind/ServiceStack.Northwind.ServiceInterface/packages.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/src/ServiceStack.Northwind/ServiceStack.Northwind.ServiceModel/Operations/CachedOperations.cs:
--------------------------------------------------------------------------------
1 | namespace ServiceStack.Northwind.ServiceModel.Operations
2 | {
3 | using System.Runtime.Serialization;
4 |
5 | [DataContract]
6 | [Route("/cached/customers")]
7 | public class CachedCustomers
8 | {
9 | }
10 |
11 | [DataContract]
12 | [Route("/cached/customers/{Id}")]
13 | public class CachedCustomerDetails
14 | {
15 | [DataMember]
16 | public string Id { get; set; }
17 | }
18 |
19 | [DataContract]
20 | [Route("/cached/orders")]
21 | [Route("/cached/orders/page/{Page}")]
22 | [Route("/cached/customers/{CustomerId}/orders")]
23 | public class CachedOrders
24 | {
25 | [DataMember]
26 | public int? Page { get; set; }
27 |
28 | [DataMember]
29 | public string CustomerId { get; set; }
30 | }
31 | }
--------------------------------------------------------------------------------
/src/ServiceStack.Northwind/ServiceStack.Northwind.ServiceModel/Operations/Customer.cs:
--------------------------------------------------------------------------------
1 | using System.Runtime.Serialization;
2 | using ServiceStack.Northwind.ServiceModel.Types;
3 | using ServiceStack.ServiceInterface.ServiceModel;
4 |
5 | namespace ServiceStack.Northwind.ServiceModel.Operations
6 | {
7 | [DataContract]
8 | public class CustomerResponse : IHasResponseStatus
9 | {
10 | public CustomerResponse()
11 | {
12 | this.ResponseStatus = new ResponseStatus();
13 | }
14 |
15 | [DataMember]
16 | public Customer Customer { get; set; }
17 |
18 | [DataMember]
19 | public ResponseStatus ResponseStatus { get; set; }
20 | }
21 |
22 | }
--------------------------------------------------------------------------------
/src/ServiceStack.Northwind/ServiceStack.Northwind.ServiceModel/Operations/CustomerDetails.cs:
--------------------------------------------------------------------------------
1 | namespace ServiceStack.Northwind.ServiceModel.Operations
2 | {
3 | using System.Collections.Generic;
4 | using System.Runtime.Serialization;
5 | using Types;
6 |
7 | [DataContract]
8 | [Route("/customers/{Id}")]
9 | public class CustomerDetails
10 | {
11 | [DataMember]
12 | public string Id { get; set; }
13 | }
14 |
15 | [DataContract]
16 | public class CustomerDetailsResponse : IHasResponseStatus
17 | {
18 | public CustomerDetailsResponse()
19 | {
20 | this.ResponseStatus = new ResponseStatus();
21 | this.CustomerOrders = new List();
22 | }
23 |
24 | [DataMember]
25 | public Customer Customer { get; set; }
26 |
27 | [DataMember]
28 | public List CustomerOrders { get; set; }
29 |
30 | [DataMember]
31 | public ResponseStatus ResponseStatus { get; set; }
32 | }
33 | }
--------------------------------------------------------------------------------
/src/ServiceStack.Northwind/ServiceStack.Northwind.ServiceModel/Operations/Customers.cs:
--------------------------------------------------------------------------------
1 | namespace ServiceStack.Northwind.ServiceModel.Operations
2 | {
3 | using System.Collections.Generic;
4 | using System.Runtime.Serialization;
5 | using Types;
6 |
7 | [DataContract]
8 | [Route("/customers")]
9 | public class Customers
10 | {
11 | }
12 |
13 | [DataContract]
14 | public class CustomersResponse : IHasResponseStatus
15 | {
16 | public CustomersResponse()
17 | {
18 | this.ResponseStatus = new ResponseStatus();
19 | this.Customers = new List();
20 | }
21 |
22 | [DataMember]
23 | public List Customers { get; set; }
24 |
25 | [DataMember]
26 | public ResponseStatus ResponseStatus { get; set; }
27 | }
28 | }
--------------------------------------------------------------------------------
/src/ServiceStack.Northwind/ServiceStack.Northwind.ServiceModel/Operations/Orders.cs:
--------------------------------------------------------------------------------
1 | namespace ServiceStack.Northwind.ServiceModel.Operations
2 | {
3 | using System.Collections.Generic;
4 | using Types;
5 |
6 | [Route("/orders")]
7 | [Route("/orders/page/{Page}")]
8 | [Route("/customers/{CustomerId}/orders")]
9 | public class Orders
10 | {
11 | public int? Page { get; set; }
12 |
13 | public string CustomerId { get; set; }
14 | }
15 |
16 | public class OrdersResponse : IHasResponseStatus
17 | {
18 | public OrdersResponse()
19 | {
20 | this.ResponseStatus = new ResponseStatus();
21 | this.Results = new List();
22 | }
23 |
24 | public List Results { get; set; }
25 |
26 | public ResponseStatus ResponseStatus { get; set; }
27 | }
28 | }
--------------------------------------------------------------------------------
/src/ServiceStack.Northwind/ServiceStack.Northwind.ServiceModel/Types/Category.cs:
--------------------------------------------------------------------------------
1 | namespace ServiceStack.Northwind.ServiceModel.Types
2 | {
3 | using System.Runtime.Serialization;
4 |
5 | [DataContract]
6 | public class Category
7 | {
8 | [DataMember]
9 | public int Id { get; set; }
10 |
11 | [DataMember]
12 | public string CategoryName { get; set; }
13 |
14 | [DataMember]
15 | public string Description { get; set; }
16 | }
17 | }
--------------------------------------------------------------------------------
/src/ServiceStack.Northwind/ServiceStack.Northwind.ServiceModel/Types/Customer.cs:
--------------------------------------------------------------------------------
1 | namespace ServiceStack.Northwind.ServiceModel.Types
2 | {
3 | using System.Runtime.Serialization;
4 |
5 | [DataContract]
6 | public class Customer
7 | {
8 | [DataMember]
9 | public string Id { get; set; }
10 |
11 | [DataMember]
12 | public string CompanyName { get; set; }
13 |
14 | [DataMember]
15 | public string ContactName { get; set; }
16 |
17 | [DataMember]
18 | public string ContactTitle { get; set; }
19 |
20 | [DataMember]
21 | public string Address { get; set; }
22 |
23 | [DataMember]
24 | public string City { get; set; }
25 |
26 | [DataMember]
27 | public string Region { get; set; }
28 |
29 | [DataMember]
30 | public string PostalCode { get; set; }
31 |
32 | [DataMember]
33 | public string Country { get; set; }
34 |
35 | [DataMember]
36 | public string Phone { get; set; }
37 |
38 | [DataMember]
39 | public string Fax { get; set; }
40 |
41 | public string Email
42 | {
43 | get { return this.ContactName.Replace(" ", ".").ToLower() + "@gmail.com"; }
44 | }
45 | }
46 | }
--------------------------------------------------------------------------------
/src/ServiceStack.Northwind/ServiceStack.Northwind.ServiceModel/Types/CustomerCustomerDemo.cs:
--------------------------------------------------------------------------------
1 | namespace ServiceStack.Northwind.ServiceModel.Types
2 | {
3 | using System.Runtime.Serialization;
4 |
5 | [DataContract]
6 | public class CustomerCustomerDemo
7 | {
8 | [DataMember]
9 | public string Id { get; set; }
10 |
11 | [DataMember]
12 | public string CustomerTypeId { get; set; }
13 | }
14 | }
--------------------------------------------------------------------------------
/src/ServiceStack.Northwind/ServiceStack.Northwind.ServiceModel/Types/CustomerDemographic.cs:
--------------------------------------------------------------------------------
1 | namespace ServiceStack.Northwind.ServiceModel.Types
2 | {
3 | using System.Runtime.Serialization;
4 |
5 | [DataContract]
6 | public class CustomerDemographic
7 | {
8 | [DataMember]
9 | public string Id { get; set; }
10 |
11 | [DataMember]
12 | public string CustomerDesc { get; set; }
13 | }
14 | }
--------------------------------------------------------------------------------
/src/ServiceStack.Northwind/ServiceStack.Northwind.ServiceModel/Types/CustomerOrders.cs:
--------------------------------------------------------------------------------
1 | namespace ServiceStack.Northwind.ServiceModel.Types
2 | {
3 | using System.Collections.Generic;
4 | using System.Runtime.Serialization;
5 |
6 | [DataContract]
7 | public class CustomerOrder
8 | {
9 | public CustomerOrder()
10 | {
11 | this.OrderDetails = new List();
12 | }
13 |
14 | [DataMember]
15 | public Order Order { get; set; }
16 |
17 | [DataMember]
18 | public List OrderDetails { get; set; }
19 | }
20 | }
--------------------------------------------------------------------------------
/src/ServiceStack.Northwind/ServiceStack.Northwind.ServiceModel/Types/EmployeeTerritory.cs:
--------------------------------------------------------------------------------
1 | namespace ServiceStack.Northwind.ServiceModel.Types
2 | {
3 | using System.Runtime.Serialization;
4 |
5 | [DataContract]
6 | public class EmployeeTerritory
7 | {
8 | public string Id
9 | {
10 | get { return this.EmployeeId + "/" + this.TerritoryId; }
11 | }
12 |
13 | [DataMember]
14 | public int EmployeeId { get; set; }
15 |
16 | [DataMember]
17 | public string TerritoryId { get; set; }
18 | }
19 | }
--------------------------------------------------------------------------------
/src/ServiceStack.Northwind/ServiceStack.Northwind.ServiceModel/Types/Order.cs:
--------------------------------------------------------------------------------
1 | namespace ServiceStack.Northwind.ServiceModel.Types
2 | {
3 | using System;
4 | using System.Runtime.Serialization;
5 |
6 | [DataContract]
7 | public class Order
8 | {
9 | [DataMember]
10 | public int Id { get; set; }
11 |
12 | [DataMember]
13 | public string CustomerId { get; set; }
14 |
15 | [DataMember]
16 | public int EmployeeId { get; set; }
17 |
18 | [DataMember]
19 | public DateTime? OrderDate { get; set; }
20 |
21 | [DataMember]
22 | public DateTime? RequiredDate { get; set; }
23 |
24 | [DataMember]
25 | public DateTime? ShippedDate { get; set; }
26 |
27 | [DataMember]
28 | public int? ShipVia { get; set; }
29 |
30 | [DataMember]
31 | public decimal Freight { get; set; }
32 |
33 | [DataMember]
34 | public string ShipName { get; set; }
35 |
36 | [DataMember]
37 | public string ShipAddress { get; set; }
38 |
39 | [DataMember]
40 | public string ShipCity { get; set; }
41 |
42 | [DataMember]
43 | public string ShipRegion { get; set; }
44 |
45 | [DataMember]
46 | public string ShipPostalCode { get; set; }
47 |
48 | [DataMember]
49 | public string ShipCountry { get; set; }
50 | }
51 | }
--------------------------------------------------------------------------------
/src/ServiceStack.Northwind/ServiceStack.Northwind.ServiceModel/Types/OrderDetail.cs:
--------------------------------------------------------------------------------
1 | namespace ServiceStack.Northwind.ServiceModel.Types
2 | {
3 | using System.Runtime.Serialization;
4 |
5 | [DataContract]
6 | public class OrderDetail
7 | {
8 | public string Id
9 | {
10 | get { return this.OrderId + "/" + this.ProductId; }
11 | }
12 |
13 | [DataMember]
14 | public int OrderId { get; set; }
15 |
16 | [DataMember]
17 | public int ProductId { get; set; }
18 |
19 | [DataMember]
20 | public decimal UnitPrice { get; set; }
21 |
22 | [DataMember]
23 | public short Quantity { get; set; }
24 |
25 | [DataMember]
26 | public double Discount { get; set; }
27 | }
28 | }
--------------------------------------------------------------------------------
/src/ServiceStack.Northwind/ServiceStack.Northwind.ServiceModel/Types/Product.cs:
--------------------------------------------------------------------------------
1 | namespace ServiceStack.Northwind.ServiceModel.Types
2 | {
3 | using System.Runtime.Serialization;
4 |
5 | [DataContract]
6 | public class Product
7 | {
8 | [DataMember]
9 | public int Id { get; set; }
10 |
11 | [DataMember]
12 | public string ProductName { get; set; }
13 |
14 | [DataMember]
15 | public int SupplierId { get; set; }
16 |
17 | [DataMember]
18 | public int CategoryId { get; set; }
19 |
20 | [DataMember]
21 | public string QuantityPerUnit { get; set; }
22 |
23 | [DataMember]
24 | public decimal UnitPrice { get; set; }
25 |
26 | [DataMember]
27 | public short UnitsInStock { get; set; }
28 |
29 | [DataMember]
30 | public short UnitsOnOrder { get; set; }
31 |
32 | [DataMember]
33 | public short ReorderLevel { get; set; }
34 |
35 | [DataMember]
36 | public bool Discontinued { get; set; }
37 | }
38 | }
--------------------------------------------------------------------------------
/src/ServiceStack.Northwind/ServiceStack.Northwind.ServiceModel/Types/Region.cs:
--------------------------------------------------------------------------------
1 | namespace ServiceStack.Northwind.ServiceModel.Types
2 | {
3 | using System.Runtime.Serialization;
4 |
5 | [DataContract]
6 | public class Region
7 | {
8 | [DataMember]
9 | public int Id { get; set; }
10 |
11 | [DataMember]
12 | public string RegionDescription { get; set; }
13 | }
14 | }
--------------------------------------------------------------------------------
/src/ServiceStack.Northwind/ServiceStack.Northwind.ServiceModel/Types/Shipper.cs:
--------------------------------------------------------------------------------
1 | namespace ServiceStack.Northwind.ServiceModel.Types
2 | {
3 | using System.Runtime.Serialization;
4 |
5 | [DataContract]
6 | public class Shipper
7 | {
8 | [DataMember]
9 | public int Id { get; set; }
10 |
11 | [DataMember]
12 | public string CompanyName { get; set; }
13 |
14 | [DataMember]
15 | public string Phone { get; set; }
16 | }
17 | }
--------------------------------------------------------------------------------
/src/ServiceStack.Northwind/ServiceStack.Northwind.ServiceModel/Types/Supplier.cs:
--------------------------------------------------------------------------------
1 | namespace ServiceStack.Northwind.ServiceModel.Types
2 | {
3 | using System.Runtime.Serialization;
4 |
5 | [DataContract]
6 | public class Supplier
7 | {
8 | [DataMember]
9 | public int Id { get; set; }
10 |
11 | [DataMember]
12 | public string CompanyName { get; set; }
13 |
14 | [DataMember]
15 | public string ContactName { get; set; }
16 |
17 | [DataMember]
18 | public string ContactTitle { get; set; }
19 |
20 | [DataMember]
21 | public string Address { get; set; }
22 |
23 | [DataMember]
24 | public string City { get; set; }
25 |
26 | [DataMember]
27 | public string Region { get; set; }
28 |
29 | [DataMember]
30 | public string PostalCode { get; set; }
31 |
32 | [DataMember]
33 | public string Country { get; set; }
34 |
35 | [DataMember]
36 | public string Phone { get; set; }
37 |
38 | [DataMember]
39 | public string Fax { get; set; }
40 |
41 | [DataMember]
42 | public string HomePage { get; set; }
43 | }
44 | }
--------------------------------------------------------------------------------
/src/ServiceStack.Northwind/ServiceStack.Northwind.ServiceModel/Types/Territory.cs:
--------------------------------------------------------------------------------
1 | namespace ServiceStack.Northwind.ServiceModel.Types
2 | {
3 | using System.Runtime.Serialization;
4 |
5 | [DataContract]
6 | public class Territory
7 | {
8 | [DataMember]
9 | public string Id { get; set; }
10 |
11 | [DataMember]
12 | public string TerritoryDescription { get; set; }
13 |
14 | [DataMember]
15 | public int RegionId { get; set; }
16 | }
17 | }
--------------------------------------------------------------------------------
/src/ServiceStack.Northwind/ServiceStack.Northwind.ServiceModel/packages.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/src/ServiceStack.Northwind/ServiceStack.Northwind/Global.asax:
--------------------------------------------------------------------------------
1 | <%@ Application Codebehind="Global.asax.cs" Inherits="ServiceStack.Northwind.Global" Language="C#" %>
2 |
--------------------------------------------------------------------------------
/src/ServiceStack.Northwind/ServiceStack.Northwind/Global.asax.cs:
--------------------------------------------------------------------------------
1 |
2 | namespace ServiceStack.Northwind
3 | {
4 | using System;
5 | using System.Web;
6 | using Funq;
7 | using ServiceInterface;
8 | using OrmLite;
9 | using Data;
10 |
11 | public class AppHost : AppHostBase
12 | {
13 | public AppHost() : base("Northwind Web Services", typeof(CustomersService).Assembly) {}
14 |
15 | public override void Configure(Container container)
16 | {
17 | container.Register(
18 | new OrmLiteConnectionFactory("~/Northwind.sqlite".MapHostAbsolutePath(), SqliteDialect.Provider));
19 |
20 | //Use Redis Cache
21 | //container.Register(new PooledRedisClientManager());
22 |
23 | VCardFormat.Register(this);
24 | }
25 | }
26 |
27 | public class Global : HttpApplication
28 | {
29 | protected void Application_Start(object sender, EventArgs e)
30 | {
31 | new AppHost().Init();
32 | }
33 | }
34 | }
--------------------------------------------------------------------------------
/src/ServiceStack.Northwind/ServiceStack.Northwind/Northwind.sqlite:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ServiceStack/ServiceStack.Examples/1319489d46665b98751dc09c0dc4a3e27f17e624/src/ServiceStack.Northwind/ServiceStack.Northwind/Northwind.sqlite
--------------------------------------------------------------------------------
/src/ServiceStack.Northwind/ServiceStack.Northwind/img/Mono-powered-big.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ServiceStack/ServiceStack.Examples/1319489d46665b98751dc09c0dc4a3e27f17e624/src/ServiceStack.Northwind/ServiceStack.Northwind/img/Mono-powered-big.png
--------------------------------------------------------------------------------
/src/ServiceStack.Northwind/ServiceStack.Northwind/img/bg-body-1024.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ServiceStack/ServiceStack.Examples/1319489d46665b98751dc09c0dc4a3e27f17e624/src/ServiceStack.Northwind/ServiceStack.Northwind/img/bg-body-1024.png
--------------------------------------------------------------------------------
/src/ServiceStack.Northwind/ServiceStack.Northwind/img/bg-footer.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ServiceStack/ServiceStack.Examples/1319489d46665b98751dc09c0dc4a3e27f17e624/src/ServiceStack.Northwind/ServiceStack.Northwind/img/bg-footer.png
--------------------------------------------------------------------------------
/src/ServiceStack.Northwind/ServiceStack.Northwind/img/btn-github.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ServiceStack/ServiceStack.Examples/1319489d46665b98751dc09c0dc4a3e27f17e624/src/ServiceStack.Northwind/ServiceStack.Northwind/img/btn-github.png
--------------------------------------------------------------------------------
/src/ServiceStack.Northwind/ServiceStack.Northwind/img/database-18x18.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ServiceStack/ServiceStack.Examples/1319489d46665b98751dc09c0dc4a3e27f17e624/src/ServiceStack.Northwind/ServiceStack.Northwind/img/database-18x18.jpg
--------------------------------------------------------------------------------
/src/ServiceStack.Northwind/ServiceStack.Northwind/img/database-icon.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ServiceStack/ServiceStack.Examples/1319489d46665b98751dc09c0dc4a3e27f17e624/src/ServiceStack.Northwind/ServiceStack.Northwind/img/database-icon.jpg
--------------------------------------------------------------------------------
/src/ServiceStack.Northwind/ServiceStack.Northwind/img/logo-txt-small.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ServiceStack/ServiceStack.Examples/1319489d46665b98751dc09c0dc4a3e27f17e624/src/ServiceStack.Northwind/ServiceStack.Northwind/img/logo-txt-small.png
--------------------------------------------------------------------------------
/src/ServiceStack.Northwind/ServiceStack.Northwind/img/vcard-ALFKI-200.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ServiceStack/ServiceStack.Examples/1319489d46665b98751dc09c0dc4a3e27f17e624/src/ServiceStack.Northwind/ServiceStack.Northwind/img/vcard-ALFKI-200.png
--------------------------------------------------------------------------------
/src/ServiceStack.Northwind/ServiceStack.Northwind/img/vcard-ALFKI-300.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ServiceStack/ServiceStack.Examples/1319489d46665b98751dc09c0dc4a3e27f17e624/src/ServiceStack.Northwind/ServiceStack.Northwind/img/vcard-ALFKI-300.png
--------------------------------------------------------------------------------
/src/ServiceStack.Northwind/ServiceStack.Northwind/img/vcard-ALFKI.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ServiceStack/ServiceStack.Examples/1319489d46665b98751dc09c0dc4a3e27f17e624/src/ServiceStack.Northwind/ServiceStack.Northwind/img/vcard-ALFKI.png
--------------------------------------------------------------------------------
/src/ServiceStack.Northwind/ServiceStack.Northwind/packages.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/src/ServiceStack.Northwind/ServiceStack.Northwind/sqlite3.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ServiceStack/ServiceStack.Examples/1319489d46665b98751dc09c0dc4a3e27f17e624/src/ServiceStack.Northwind/ServiceStack.Northwind/sqlite3.dll
--------------------------------------------------------------------------------
/src/StarterTemplates/ConsoleAppHost/App.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/src/StarterTemplates/ConsoleAppHost/default.htm:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ServiceStack/ServiceStack.Examples/1319489d46665b98751dc09c0dc4a3e27f17e624/src/StarterTemplates/ConsoleAppHost/default.htm
--------------------------------------------------------------------------------
/src/StarterTemplates/ConsoleAppHost/packages.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/src/StarterTemplates/CustomPath40/Global.asax:
--------------------------------------------------------------------------------
1 | <%@ Application Codebehind="Global.asax.cs" Inherits="CustomPath40.Global" Language="C#" %>
2 |
--------------------------------------------------------------------------------
/src/StarterTemplates/CustomPath40/Global.asax.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using ServiceStack;
3 | using StarterTemplates.Common;
4 | using Funq;
5 |
6 | namespace CustomPath40
7 | {
8 | ///
9 | /// Create your ServiceStack web service application with a singleton AppHost.
10 | ///
11 | public class AppHost : AppHostBase
12 | {
13 | ///
14 | /// Initializes a new instance of your ServiceStack application, with the specified name and assembly containing the services.
15 | ///
16 | public AppHost() : base("StarterTemplate ASP.NET Host", typeof(HelloService).Assembly) { }
17 |
18 | ///
19 | /// Configure the container with the necessary routes for your ServiceStack application.
20 | ///
21 | /// The built-in IoC used with ServiceStack.
22 | public override void Configure(Container container)
23 | {
24 | container.Register(new TodoRepository());
25 | }
26 | }
27 |
28 | public class Global : System.Web.HttpApplication
29 | {
30 | void Application_Start(object sender, EventArgs e)
31 | {
32 | //Initialize your application
33 | (new AppHost()).Init();
34 | }
35 | }
36 | }
37 |
--------------------------------------------------------------------------------
/src/StarterTemplates/CustomPath40/default.htm:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ServiceStack/ServiceStack.Examples/1319489d46665b98751dc09c0dc4a3e27f17e624/src/StarterTemplates/CustomPath40/default.htm
--------------------------------------------------------------------------------
/src/StarterTemplates/CustomPath40/packages.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/src/StarterTemplates/CustomPath45/Global.asax:
--------------------------------------------------------------------------------
1 | <%@ Application Codebehind="Global.asax.cs" Inherits="CustomPath45.Global" Language="C#" %>
2 |
--------------------------------------------------------------------------------
/src/StarterTemplates/CustomPath45/Global.asax.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using Funq;
3 | using ServiceStack;
4 | using StarterTemplates.Common;
5 |
6 | namespace CustomPath45
7 | {
8 | ///
9 | /// Create your ServiceStack web service application with a singleton AppHost.
10 | ///
11 | public class AppHost : AppHostBase
12 | {
13 | ///
14 | /// Initializes a new instance of your ServiceStack application, with the specified name and assembly containing the services.
15 | ///
16 | public AppHost() : base("StarterTemplate ASP.NET Host", typeof(HelloService).Assembly) { }
17 |
18 | ///
19 | /// Configure the container with the necessary routes for your ServiceStack application.
20 | ///
21 | /// The built-in IoC used with ServiceStack.
22 | public override void Configure(Container container)
23 | {
24 | container.Register(new TodoRepository());
25 | }
26 | }
27 |
28 | public class Global : System.Web.HttpApplication
29 | {
30 | void Application_Start(object sender, EventArgs e)
31 | {
32 | //Initialize your application
33 | (new AppHost()).Init();
34 | }
35 | }
36 | }
37 |
--------------------------------------------------------------------------------
/src/StarterTemplates/CustomPath45/default.htm:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ServiceStack/ServiceStack.Examples/1319489d46665b98751dc09c0dc4a3e27f17e624/src/StarterTemplates/CustomPath45/default.htm
--------------------------------------------------------------------------------
/src/StarterTemplates/CustomPath45/packages.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/src/StarterTemplates/README.md:
--------------------------------------------------------------------------------
1 | # Base Starter Templates for different ServiceStack Hosts
2 |
3 | These starter templates show the default configuration required to run ServiceStack under a number of different hosts:
4 |
5 | * RootPath45 - Host at '/' on .NET 4.5
6 | * RootPath40 - Host at '/' on .NET 4.0
7 | * CustomPath45 - Host at '/api' on .NET 4.5
8 | * CustomPath40 - Host at '/api' on .NET 4.0
9 | * ConsoleAppHost - Host as a stand-alone Console Application using HttpListener
10 |
11 | Run run the script below to start the hosts above on VS.NET WebDev.WebServer.EXE at ports 5001-5004:
12 | start_vs2010_webserver.bat
13 |
14 | When embedding static files in a Console or Windows Service host, remember to set the Build Action = "Content" and Copy to Output Directory settings.
15 |
16 |
--------------------------------------------------------------------------------
/src/StarterTemplates/RootPath40/Global.asax:
--------------------------------------------------------------------------------
1 | <%@ Application Codebehind="Global.asax.cs" Inherits="RootPath40.Global" Language="C#" %>
2 |
--------------------------------------------------------------------------------
/src/StarterTemplates/RootPath40/Global.asax.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using ServiceStack;
3 | using StarterTemplates.Common;
4 | using Funq;
5 |
6 | namespace RootPath40
7 | {
8 | ///
9 | /// Create your ServiceStack web service application with a singleton AppHost.
10 | ///
11 | public class AppHost : AppHostBase
12 | {
13 | ///
14 | /// Initializes a new instance of your ServiceStack application, with the specified name and assembly containing the services.
15 | ///
16 | public AppHost() : base("StarterTemplate ASP.NET Host", typeof(HelloService).Assembly) { }
17 |
18 | ///
19 | /// Configure the container with the necessary routes for your ServiceStack application.
20 | ///
21 | /// The built-in IoC used with ServiceStack.
22 | public override void Configure(Container container)
23 | {
24 | container.Register(new TodoRepository());
25 | }
26 | }
27 |
28 | public class Global : System.Web.HttpApplication
29 | {
30 | void Application_Start(object sender, EventArgs e)
31 | {
32 | //Initialize your application
33 | (new AppHost()).Init();
34 | }
35 | }
36 | }
37 |
--------------------------------------------------------------------------------
/src/StarterTemplates/RootPath40/Web.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
--------------------------------------------------------------------------------
/src/StarterTemplates/RootPath40/default.htm:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ServiceStack/ServiceStack.Examples/1319489d46665b98751dc09c0dc4a3e27f17e624/src/StarterTemplates/RootPath40/default.htm
--------------------------------------------------------------------------------
/src/StarterTemplates/RootPath40/packages.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/src/StarterTemplates/RootPath45/Global.asax:
--------------------------------------------------------------------------------
1 | <%@ Application Codebehind="Global.asax.cs" Inherits="RootPath45.Global" Language="C#" %>
2 |
--------------------------------------------------------------------------------
/src/StarterTemplates/RootPath45/Global.asax.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using Funq;
3 | using ServiceStack;
4 | using StarterTemplates.Common;
5 |
6 | namespace RootPath45
7 | {
8 | ///
9 | /// Create your ServiceStack web service application with a singleton AppHost.
10 | ///
11 | public class AppHost : AppHostBase
12 | {
13 | ///
14 | /// Initializes a new instance of your ServiceStack application, with the specified name and assembly containing the services.
15 | ///
16 | public AppHost() : base("StarterTemplate ASP.NET Host", typeof(HelloService).Assembly) { }
17 |
18 | ///
19 | /// Configure the container with the necessary routes for your ServiceStack application.
20 | ///
21 | /// The built-in IoC used with ServiceStack.
22 | public override void Configure(Container container)
23 | {
24 | container.Register(new TodoRepository());
25 | }
26 | }
27 |
28 | public class Global : System.Web.HttpApplication
29 | {
30 | void Application_Start(object sender, EventArgs e)
31 | {
32 | //Initialize your application
33 | (new AppHost()).Init();
34 | }
35 | }
36 | }
37 |
--------------------------------------------------------------------------------
/src/StarterTemplates/RootPath45/Web.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
--------------------------------------------------------------------------------
/src/StarterTemplates/RootPath45/default.htm:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ServiceStack/ServiceStack.Examples/1319489d46665b98751dc09c0dc4a3e27f17e624/src/StarterTemplates/RootPath45/default.htm
--------------------------------------------------------------------------------
/src/StarterTemplates/RootPath45/packages.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/src/StarterTemplates/StarterTemplates.Common/HelloService.cs:
--------------------------------------------------------------------------------
1 | using System.ComponentModel;
2 | using ServiceStack;
3 |
4 | namespace StarterTemplates.Common
5 | {
6 | ///
7 | /// Define your ServiceStack web service request (i.e. the Request DTO).
8 | ///
9 | [Description("ServiceStack's Hello World web service.")]
10 | [Route("/hello")]
11 | [Route("/hello/{Name*}")]
12 | public class Hello
13 | {
14 | public string Name { get; set; }
15 | }
16 |
17 | ///
18 | /// Define your ServiceStack web service response (i.e. Response DTO).
19 | ///
20 | public class HelloResponse : IHasResponseStatus
21 | {
22 | public string Result { get; set; }
23 | public ResponseStatus ResponseStatus { get; set; }
24 | }
25 |
26 | ///
27 | /// Create your ServiceStack web service implementation.
28 | ///
29 | public class HelloService : Service
30 | {
31 | public object Any(Hello request)
32 | {
33 | return new HelloResponse { Result = "Hello, " + request.Name };
34 | }
35 | }
36 | }
--------------------------------------------------------------------------------
/src/StarterTemplates/StarterTemplates.Common/StarterTemplateAppHost.cs:
--------------------------------------------------------------------------------
1 | using ServiceStack;
2 | using ServiceStack.Configuration;
3 |
4 | namespace StarterTemplates.Common
5 | {
6 |
7 | //ASP.NET Hosts
8 | public class StarterTemplateAppHost
9 | : AppHostBase
10 | {
11 | static readonly IAppSettings AppSettings = new AppSettings();
12 |
13 | public StarterTemplateAppHost()
14 | : base(AppSettings.GetString("ServiceName") ?? "StarterTemplate ASP.NET Host", typeof(HelloService).Assembly) { }
15 |
16 | public override void Configure(Funq.Container container)
17 | {
18 | container.Register(new TodoRepository());
19 | }
20 | }
21 |
22 | //HttpListener Hosts
23 | public class StarterTemplateAppListenerHost
24 | : AppHostHttpListenerBase
25 | {
26 | static readonly IAppSettings AppSettings = new AppSettings();
27 |
28 | public StarterTemplateAppListenerHost()
29 | : base(AppSettings.GetString("ServiceName") ?? "StarterTemplate HttpListener", typeof(HelloService).Assembly) { }
30 |
31 | public override void Configure(Funq.Container container)
32 | {
33 | container.Register(new TodoRepository());
34 | }
35 | }
36 | }
37 |
--------------------------------------------------------------------------------
/src/StarterTemplates/StarterTemplates.Common/packages.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/src/StarterTemplates/StarterTemplates.Tests/TodoAppTests.cs:
--------------------------------------------------------------------------------
1 | using NUnit.Framework;
2 | using ServiceStack;
3 | using System.Collections.Generic;
4 | using StarterTemplates.Common;
5 |
6 | namespace StarterTemplates.Tests
7 | {
8 | [TestFixture]
9 | public class TodoAppTests
10 | {
11 | [Test]
12 | public void Can_view_create_and_delete_TODOs_over_REST()
13 | {
14 | var restClient = new JsonServiceClient("http://localhost:37022/");
15 |
16 | var all = restClient.Get>("/todos");
17 | Assert.That(all.Count, Is.EqualTo(0));
18 |
19 | var todo = restClient.Post("/todos", new Todo { Content = "New TODO", Order = 1 });
20 | Assert.That(todo.Id, Is.GreaterThan(0));
21 | Assert.That(todo.Content, Is.EqualTo("New TODO"));
22 |
23 | all = restClient.Get>("/todos");
24 | Assert.That(all.Count, Is.EqualTo(1));
25 |
26 | todo.Content = "Updated TODO";
27 | todo = restClient.Post("/todos", todo);
28 | Assert.That(todo.Content, Is.EqualTo("Updated TODO"));
29 |
30 | restClient.Delete("/todos/" + todo.Id);
31 |
32 | all = restClient.Get>("/todos");
33 | Assert.That(all.Count, Is.EqualTo(0));
34 | }
35 | }
36 | }
--------------------------------------------------------------------------------
/src/StarterTemplates/StarterTemplates.Tests/packages.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/src/StarterTemplates/StarterTemplates.Tests/start_vs2010_webserver.bat:
--------------------------------------------------------------------------------
1 | @ECHO OFF
2 |
3 | SET HOST_ROOT="C:\src\ServiceStack.Examples\src\StarterTemplates"
4 |
5 | SET WEB_SERVER="C:\Program Files\Common Files\microsoft shared\DevServer\10.0\WebDev.WebServer20.EXE"
6 |
7 | %WEB_SERVER% /port:5001 /path:"%HOST_ROOT%\CustomPath35" /vpath:"/"
8 | %WEB_SERVER% /port:5003 /path:"%HOST_ROOT%\RootPath35" /vpath:"/"
9 |
10 | SET WEB_SERVER="C:\Program Files\Common Files\microsoft shared\DevServer\10.0\WebDev.WebServer40.EXE"
11 |
12 | %WEB_SERVER% /port:5002 /path:"%HOST_ROOT%\CustomPath40" /vpath:"/"
13 | %WEB_SERVER% /port:5004 /path:"%HOST_ROOT%\RootPath40" /vpath:"/"
14 |
15 |
16 | REM HttpListener
17 | %HOST_ROOT%\ConsoleAppHost\bin\Debug\ConsoleAppHost.exe
--------------------------------------------------------------------------------
/src/StarterTemplates/WinServiceAppHost/Program.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.ServiceProcess;
3 | using System.Threading;
4 | using StarterTemplates.Common;
5 |
6 | namespace WinServiceAppHost
7 | {
8 | static class Program
9 | {
10 | private const string ListeningOn = "http://localhost:83/";
11 |
12 | ///
13 | /// The main entry point for the application.
14 | ///
15 | static void Main()
16 | {
17 | var appHost = new StarterTemplateAppListenerHost();
18 |
19 | //Allow you to debug your Windows Service while you're deleloping it.
20 | #if DEBUG
21 | Console.WriteLine("Running WinServiceAppHost in Console mode");
22 | try
23 | {
24 | appHost.Init();
25 | appHost.Start(ListeningOn);
26 |
27 | Console.WriteLine("Press +C to stop.");
28 | Thread.Sleep(Timeout.Infinite);
29 | }
30 | catch (Exception ex)
31 | {
32 | Console.WriteLine("ERROR: {0}: {1}", ex.GetType().Name, ex.Message);
33 | throw;
34 | }
35 | finally
36 | {
37 | appHost.Stop();
38 | }
39 |
40 | Console.WriteLine("WinServiceAppHost has finished");
41 |
42 | #else
43 | //When in RELEASE mode it will run as a Windows Service with the code below
44 |
45 | ServiceBase[] ServicesToRun;
46 | ServicesToRun = new ServiceBase[]
47 | {
48 | new WinService(appHost, ListeningOn)
49 | };
50 | ServiceBase.Run(ServicesToRun);
51 | #endif
52 |
53 | }
54 | }
55 | }
56 |
--------------------------------------------------------------------------------
/src/StarterTemplates/WinServiceAppHost/WinService.Designer.cs:
--------------------------------------------------------------------------------
1 | namespace WinServiceAppHost
2 | {
3 | partial class WinService
4 | {
5 | ///
6 | /// Required designer variable.
7 | ///
8 | private System.ComponentModel.IContainer components = null;
9 |
10 | ///
11 | /// Clean up any resources being used.
12 | ///
13 | /// true if managed resources should be disposed; otherwise, false.
14 | protected override void Dispose(bool disposing)
15 | {
16 | if (disposing && (components != null))
17 | {
18 | components.Dispose();
19 | }
20 | base.Dispose(disposing);
21 | }
22 |
23 | #region Component Designer generated code
24 |
25 | ///
26 | /// Required method for Designer support - do not modify
27 | /// the contents of this method with the code editor.
28 | ///
29 | private void InitializeComponent()
30 | {
31 | components = new System.ComponentModel.Container();
32 | this.ServiceName = "WinService";
33 | }
34 |
35 | #endregion
36 | }
37 | }
38 |
--------------------------------------------------------------------------------
/src/StarterTemplates/WinServiceAppHost/WinService.cs:
--------------------------------------------------------------------------------
1 | using System.ServiceProcess;
2 | using ServiceStack;
3 |
4 | namespace WinServiceAppHost
5 | {
6 | public partial class WinService : ServiceBase
7 | {
8 | private readonly AppHostHttpListenerBase appHost;
9 | private readonly string listeningOn;
10 |
11 | public WinService(AppHostHttpListenerBase appHost, string listeningOn)
12 | {
13 | this.appHost = appHost;
14 | this.listeningOn = listeningOn;
15 |
16 | this.appHost.Init();
17 |
18 | InitializeComponent();
19 | }
20 |
21 | protected override void OnStart(string[] args)
22 | {
23 | this.appHost.Start(listeningOn);
24 | }
25 |
26 | protected override void OnStop()
27 | {
28 | this.appHost.Stop();
29 | }
30 | }
31 | }
32 |
--------------------------------------------------------------------------------
/src/StarterTemplates/WinServiceAppHost/WinServiceInstaller.cs:
--------------------------------------------------------------------------------
1 | using System.ComponentModel;
2 | using System.Configuration.Install;
3 |
4 | namespace WinServiceAppHost
5 | {
6 | [RunInstaller(true)]
7 | public partial class WinServiceInstaller : Installer
8 | {
9 | public WinServiceInstaller()
10 | {
11 | InitializeComponent();
12 | }
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/src/StarterTemplates/WinServiceAppHost/app.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/src/StarterTemplates/WinServiceAppHost/default.htm:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ServiceStack/ServiceStack.Examples/1319489d46665b98751dc09c0dc4a3e27f17e624/src/StarterTemplates/WinServiceAppHost/default.htm
--------------------------------------------------------------------------------
/src/StarterTemplates/WinServiceAppHost/install.bat:
--------------------------------------------------------------------------------
1 | REM INSTALL THIS WINDOWS SERVICE:
2 | REM 1. Build in Release mode
3 |
4 | SET INSTALL_UTL="C:\Windows\Microsoft.NET\Framework\v2.0.50727\InstallUtil.exe"
5 |
6 | %INSTALL_UTL% bin\Release\WinServiceAppHost.exe
7 |
--------------------------------------------------------------------------------
/src/StarterTemplates/WinServiceAppHost/packages.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/src/StarterTemplates/WinServiceAppHost/uninstall.bat:
--------------------------------------------------------------------------------
1 | SET INSTALL_UTL="C:\Windows\Microsoft.NET\Framework\v2.0.50727\InstallUtil.exe"
2 |
3 | %INSTALL_UTL% /u bin\Release\WinServiceAppHost.exe
4 |
--------------------------------------------------------------------------------
/tests/ServiceStack.Examples.Tests.Integration/packages.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/tests/ServiceStack.Examples.Tests.Integration/sqlite3.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ServiceStack/ServiceStack.Examples/1319489d46665b98751dc09c0dc4a3e27f17e624/tests/ServiceStack.Examples.Tests.Integration/sqlite3.dll
--------------------------------------------------------------------------------
/tests/ServiceStack.Examples.Tests/GetFactorialTests.cs:
--------------------------------------------------------------------------------
1 | using NUnit.Framework;
2 | using ServiceStack.Examples.ServiceInterface;
3 | using ServiceStack.Examples.ServiceModel;
4 |
5 | namespace ServiceStack.Examples.Tests
6 | {
7 | [TestFixture]
8 | public class GetFactorialTests : TestHostBase
9 | {
10 | [Test]
11 | public void GetFactorial_Test()
12 | {
13 | var request = new GetFactorial { ForNumber = 4 };
14 |
15 | var handler = new GetFactorialService();
16 |
17 | var response = handler.Any(request);
18 |
19 | Assert.That(response.Result, Is.EqualTo(4 * 3 * 2 * 1));
20 | }
21 | }
22 | }
--------------------------------------------------------------------------------
/tests/ServiceStack.Examples.Tests/GetFibonacciNumbersTests.cs:
--------------------------------------------------------------------------------
1 | using NUnit.Framework;
2 | using ServiceStack.Examples.ServiceInterface;
3 | using ServiceStack.Examples.ServiceModel;
4 | using ExampleConfig = ServiceStack.Examples.ServiceInterface.ExampleConfig;
5 |
6 | namespace ServiceStack.Examples.Tests
7 | {
8 | [TestFixture]
9 | public class GetFibonacciNumbersTests
10 | : TestHostBase
11 | {
12 | [Test]
13 | public void GetFibonacciNumbers_Test()
14 | {
15 | var request = new GetFibonacciNumbers { Take = 5 };
16 |
17 | var handler = new GetFibonacciNumbersService(
18 | new ExampleConfig { DefaultFibonacciLimit = 10 });
19 |
20 | var response = handler.Any(request);
21 |
22 | Assert.That(response.Results.Count, Is.EqualTo(request.Take));
23 | Assert.That(response.Results, Is.EqualTo(new[] { 1, 2, 3, 5, 8 }));
24 | }
25 | }
26 | }
--------------------------------------------------------------------------------
/tests/ServiceStack.Examples.Tests/LoggerTests.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using NUnit.Framework;
3 | using ServiceStack.Examples.ServiceModel.Types;
4 | using ServiceStack.Text;
5 |
6 | namespace ServiceStack.Examples.Tests
7 | {
8 | [TestFixture]
9 | public class LoggerTests
10 | {
11 | [Test]
12 | public void Create_test_data()
13 | {
14 | var loggers = new ArrayOfLogger
15 | {
16 | new Logger
17 | {
18 | Id = 786,
19 | Devices = new ArrayOfDevice
20 | {
21 | new Device
22 | {
23 | Id = 5955,
24 | Type = "Panel",
25 | TimeStamp = 1199303309,
26 | Channels = new ArrayOfChannel
27 | {
28 | {new Channel("Temperature", "58")},
29 | {new Channel("Status", "On")},
30 | }
31 | },
32 | new Device
33 | {
34 | Id = 5956,
35 | Type = "Tank",
36 | TimeStamp = 1199303309,
37 | Channels = new ArrayOfChannel
38 | {
39 | { new Channel("Volume", "10035") },
40 | { new Channel("Status", "Full") },
41 | }
42 | },
43 | }
44 | }
45 | };
46 |
47 | var jsv = TypeSerializer.SerializeToString(loggers);
48 | Console.WriteLine(jsv);
49 | }
50 |
51 | }
52 | }
--------------------------------------------------------------------------------
/tests/ServiceStack.Examples.Tests/MonoTests/Soap12WsdlProgram.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using ServiceStack.Examples.ServiceModel;
3 | using ServiceStack.Metadata;
4 |
5 | namespace ServiceStack.Examples.Tests.MonoTests
6 | {
7 | public class Soap12WsdlProgram
8 | {
9 | public static void Main()
10 | {
11 | var xsd = new XsdGenerator
12 | {
13 | OperationTypes = new[] {
14 | typeof(GetUsers), typeof(DeleteAllUsers), typeof(StoreNewUser),
15 | typeof(GetFactorial), typeof(GetFibonacciNumbers)
16 | },
17 | OptimizeForFlash = false,
18 | }.ToString();
19 |
20 | Console.WriteLine("xsd: " + xsd);
21 | }
22 | }
23 | }
--------------------------------------------------------------------------------
/tests/ServiceStack.Examples.Tests/packages.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/tests/ServiceStack.Examples.Tests/sqlite3.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ServiceStack/ServiceStack.Examples/1319489d46665b98751dc09c0dc4a3e27f17e624/tests/ServiceStack.Examples.Tests/sqlite3.dll
--------------------------------------------------------------------------------