diff --git a/lib/ServiceStack.Common.dll b/lib/ServiceStack.Common.dll deleted file mode 100644 index 87bb1dc7..00000000 Binary files a/lib/ServiceStack.Common.dll and /dev/null differ diff --git a/lib/ServiceStack.Interfaces.dll b/lib/ServiceStack.Interfaces.dll deleted file mode 100644 index 95999b36..00000000 Binary files a/lib/ServiceStack.Interfaces.dll and /dev/null differ diff --git a/lib/ServiceStack.OrmLite.SqlServer.dll b/lib/ServiceStack.OrmLite.SqlServer.dll deleted file mode 100644 index eba13c5f..00000000 Binary files a/lib/ServiceStack.OrmLite.SqlServer.dll and /dev/null differ diff --git a/lib/ServiceStack.OrmLite.Sqlite.dll b/lib/ServiceStack.OrmLite.Sqlite.dll deleted file mode 100644 index ceca46f6..00000000 Binary files a/lib/ServiceStack.OrmLite.Sqlite.dll and /dev/null differ diff --git a/lib/ServiceStack.OrmLite.dll b/lib/ServiceStack.OrmLite.dll deleted file mode 100644 index df626f2b..00000000 Binary files a/lib/ServiceStack.OrmLite.dll and /dev/null differ diff --git a/lib/ServiceStack.Razor.dll b/lib/ServiceStack.Razor.dll deleted file mode 100644 index a6ca7768..00000000 Binary files a/lib/ServiceStack.Razor.dll and /dev/null differ diff --git a/lib/ServiceStack.Razor.dll.config b/lib/ServiceStack.Razor.dll.config deleted file mode 100644 index 0faceacf..00000000 --- a/lib/ServiceStack.Razor.dll.config +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - - - - - diff --git a/lib/ServiceStack.RazorEngine.dll b/lib/ServiceStack.RazorEngine.dll deleted file mode 100644 index 383e7397..00000000 Binary files a/lib/ServiceStack.RazorEngine.dll and /dev/null differ diff --git a/lib/ServiceStack.RazorEngine.dll.config b/lib/ServiceStack.RazorEngine.dll.config deleted file mode 100644 index 0faceacf..00000000 --- a/lib/ServiceStack.RazorEngine.dll.config +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - - - - - diff --git a/lib/ServiceStack.Redis.dll b/lib/ServiceStack.Redis.dll deleted file mode 100644 index 6433b5d5..00000000 Binary files a/lib/ServiceStack.Redis.dll and /dev/null differ diff --git a/lib/ServiceStack.ServiceInterface.dll b/lib/ServiceStack.ServiceInterface.dll deleted file mode 100644 index 97824d76..00000000 Binary files a/lib/ServiceStack.ServiceInterface.dll and /dev/null differ diff --git a/lib/ServiceStack.Text.dll b/lib/ServiceStack.Text.dll deleted file mode 100644 index 6774c69b..00000000 Binary files a/lib/ServiceStack.Text.dll and /dev/null differ diff --git a/lib/ServiceStack.dll b/lib/ServiceStack.dll deleted file mode 100644 index b6d20de5..00000000 Binary files a/lib/ServiceStack.dll and /dev/null differ diff --git a/src/Backbone.Todos/Backbone.Todos.csproj b/src/Backbone.Todos/Backbone.Todos.csproj index e82b9ae5..6470b4fd 100644 --- a/src/Backbone.Todos/Backbone.Todos.csproj +++ b/src/Backbone.Todos/Backbone.Todos.csproj @@ -32,28 +32,26 @@ 4 - - False - ..\..\lib\ServiceStack.dll + + ..\packages\ServiceStack.3.9.11\lib\net35\ServiceStack.dll - - False - ..\..\lib\ServiceStack.Common.dll + + ..\packages\ServiceStack.Common.3.9.11\lib\net35\ServiceStack.Common.dll - - False - ..\..\lib\ServiceStack.Interfaces.dll + + ..\packages\ServiceStack.Common.3.9.11\lib\net35\ServiceStack.Interfaces.dll - - False - ..\..\lib\ServiceStack.Redis.dll + + ..\packages\ServiceStack.OrmLite.SqlServer.3.9.9\lib\ServiceStack.OrmLite.SqlServer.dll - - False - ..\..\lib\ServiceStack.ServiceInterface.dll + + ..\packages\ServiceStack.Redis.3.9.11\lib\net35\ServiceStack.Redis.dll - - ..\..\lib\ServiceStack.Text.dll + + ..\packages\ServiceStack.3.9.11\lib\net35\ServiceStack.ServiceInterface.dll + + + ..\packages\ServiceStack.Text.3.9.11\lib\net35\ServiceStack.Text.dll @@ -62,7 +60,7 @@ - + @@ -80,11 +78,11 @@ - - - - - + + + + + @@ -93,7 +91,9 @@ - + + + diff --git a/src/Backbone.Todos/todos.css b/src/Backbone.Todos/Content/Css/todos.css similarity index 99% rename from src/Backbone.Todos/todos.css rename to src/Backbone.Todos/Content/Css/todos.css index 8fdd0c83..6c32c883 100644 --- a/src/Backbone.Todos/todos.css +++ b/src/Backbone.Todos/Content/Css/todos.css @@ -147,7 +147,7 @@ html { cursor: pointer; width: 20px; height: 20px; - background: url(destroy.png) no-repeat 0 0; + background: url(../Images/destroy.png) no-repeat 0 0; } #todo-list li:hover .todo-destroy { display: block; diff --git a/src/Backbone.Todos/destroy.png b/src/Backbone.Todos/Content/Images/destroy.png similarity index 100% rename from src/Backbone.Todos/destroy.png rename to src/Backbone.Todos/Content/Images/destroy.png diff --git a/src/Backbone.Todos/Global.asax.cs b/src/Backbone.Todos/Global.asax.cs index cb3d88da..f3a6b8f2 100644 --- a/src/Backbone.Todos/Global.asax.cs +++ b/src/Backbone.Todos/Global.asax.cs @@ -2,83 +2,113 @@ using ServiceStack.Redis; using ServiceStack.ServiceInterface; using ServiceStack.WebHost.Endpoints; +using Funq; +using ServiceStack.Text; //The entire C# source code for the ServiceStack + Redis TODO REST backend. There is no other .cs :) namespace Backbone.Todos { - //REST Resource DTO - public class Todo - { - public long Id { get; set; } - public string Content { get; set; } - public int Order { get; set; } - public bool Done { get; set; } - } + /// + /// Define your ServiceStack web service request (i.e. Request DTO). + /// + public class Todo + { + public long Id { get; set; } + public string Content { get; set; } + public int Order { get; set; } + public bool Done { get; set; } + } - //Todo REST Service implementation - public class TodoService : RestServiceBase - { - public IRedisClientsManager RedisManager { get; set; } //Injected by IOC + /// + /// Create your ServiceStack rest-ful web service implementation. + /// + public class TodoService : RestServiceBase + { + /// + /// Gets or sets the Redis Manager. The built-in IoC used with ServiceStack autowires this property. + /// + public IRedisClientsManager RedisManager { get; set; } - public override object OnGet(Todo request) - { - //return single todo - if (request.Id != default(long)) - return RedisManager.ExecAs(r => r.GetById(request.Id)); + public override object OnGet(Todo todo) + { + //Return a single Todo if the id is provided. + if (todo.Id != default(long)) + { + return RedisManager.ExecAs(r => r.GetById(todo.Id)); + } - //return all todos - return RedisManager.ExecAs(r => r.GetAll()); - } + //Return all Todos items. + return RedisManager.ExecAs(r => r.GetAll()); + } - //Handles creaing a new and updating existing todo - public override object OnPost(Todo todo) - { - RedisManager.ExecAs(r => { - //Get next id for new todo - if (todo.Id == default(long)) todo.Id = r.GetNextSequence(); - r.Store(todo); - }); - return todo; - } + /// + /// Handles creating and updating the Todo items. + /// + /// The todo. + /// + public override object OnPost(Todo todo) + { + RedisManager.ExecAs(r => + { + //Get next id for new todo + if (todo.Id == default(long)) todo.Id = r.GetNextSequence(); + r.Store(todo); + }); + return todo; + } - public override object OnPut(Todo request) - { - return OnPost(request); - } + /// + /// Handles creating and updating the Todo items. + /// + /// The todo. + /// + public override object OnPut(Todo todo) + { + return OnPost(todo); + } - public override object OnDelete(Todo request) - { - RedisManager.ExecAs(r => r.DeleteById(request.Id)); - return null; - } - } + public override object OnDelete(Todo todo) + { + RedisManager.ExecAs(r => r.DeleteById(todo.Id)); + return null; + } + } - //Configure ServiceStack.NET web service host - public class AppHost : AppHostBase - { - //Tell ServiceStack the name and where to find your web services - public AppHost() : base("Backbone.js TODO", typeof(TodoService).Assembly) { } + /// + /// Create your ServiceStack web service application with a singleton AppHost. + /// + public class ToDoAppHost : AppHostBase + { + /// + /// Initializes a new instance of your ServiceStack application, with the specified name and assembly containing the services. + /// + public ToDoAppHost() : base("Backbone.js TODO", typeof(TodoService).Assembly) { } - public override void Configure(Funq.Container container) - { - //Set JSON web services to return idiomatic JSON camelCase properties - ServiceStack.Text.JsConfig.EmitCamelCaseNames = true; + /// + /// Configure the container with the necessary routes for your ServiceStack application. + /// + /// The built-in IoC used with ServiceStack. + public override void Configure(Container container) + { + //Configure ServiceStack Json web services to return idiomatic Json camelCase properties. + JsConfig.EmitCamelCaseNames = true; - //Register Redis factory in Funq IOC - container.Register(new BasicRedisClientManager("localhost:6379")); + //Register Redis factory in Funq IoC. The default port for Redis is 6379. + container.Register(new BasicRedisClientManager("localhost:6379")); - //Register user-defined REST Paths - Routes - .Add("/todos") - .Add("/todos/{Id}"); - } - } + //Register user-defined REST Paths + Routes + .Add("/todos") + .Add("/todos/{Id}"); + } + } - public class Global : System.Web.HttpApplication - { - protected void Application_Start(object sender, EventArgs e) - { - new AppHost().Init(); //Start ServiceStack App - } - } + public class Global : System.Web.HttpApplication + { + protected void Application_Start(object sender, EventArgs e) + { + //Initialize your application + (new ToDoAppHost()).Init(); + } + } } \ No newline at end of file diff --git a/src/Backbone.Todos/js/backbone.js b/src/Backbone.Todos/Scripts/backbone.js similarity index 100% rename from src/Backbone.Todos/js/backbone.js rename to src/Backbone.Todos/Scripts/backbone.js diff --git a/src/Backbone.Todos/js/jquery-1.5.js b/src/Backbone.Todos/Scripts/jquery-1.5.js similarity index 100% rename from src/Backbone.Todos/js/jquery-1.5.js rename to src/Backbone.Todos/Scripts/jquery-1.5.js diff --git a/src/Backbone.Todos/todos.js b/src/Backbone.Todos/Scripts/todos.js similarity index 100% rename from src/Backbone.Todos/todos.js rename to src/Backbone.Todos/Scripts/todos.js diff --git a/src/Backbone.Todos/js/underscore-1.1.5.js b/src/Backbone.Todos/Scripts/underscore-1.1.5.js similarity index 100% rename from src/Backbone.Todos/js/underscore-1.1.5.js rename to src/Backbone.Todos/Scripts/underscore-1.1.5.js diff --git a/src/Backbone.Todos/Web.config b/src/Backbone.Todos/Web.config index 97e50b13..e01dfa76 100644 --- a/src/Backbone.Todos/Web.config +++ b/src/Backbone.Todos/Web.config @@ -1,41 +1,41 @@  - - - -
- -
-
-
-
- + + + +
+ +
+
+
+
- + + - - - - - + + - - - - - - + + - - - - - - - - - - + + + + + + + + + + + + - - - - - + + + + + - - - - - + - + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + diff --git a/src/Backbone.Todos/default.htm b/src/Backbone.Todos/default.htm index 66bf4e1f..c4fa31f7 100644 --- a/src/Backbone.Todos/default.htm +++ b/src/Backbone.Todos/default.htm @@ -1,64 +1,56 @@ - - + Backbone Demo: Todos - - - - - - - - - - ServiceStack Home - + + + + + + + + + + ServiceStack Home + -
- -
-

Todos

-
- -
- -
- - +
+

+ Todos

- -
-
    +
    +
    + + +
    +
    +
      +
    +
    +
    +
    - -
    - -
    -
    - -
    - Created by -
    - Jérôme Gravel-Niquet -
    -
    - Powered By Open Source -
    - servicestack.net - | redis - | mono + Created by +
    + Jérôme Gravel-Niquet +
    +
    + Powered By Open Source +
    + servicestack.net | redis + | mono
    - - - - - - - - + + diff --git a/src/Backbone.Todos/packages.config b/src/Backbone.Todos/packages.config new file mode 100644 index 00000000..26375517 --- /dev/null +++ b/src/Backbone.Todos/packages.config @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/src/Docs/Docs.Logic/CustomMarkdownPage.cs b/src/Docs/Docs.Logic/CustomMarkdownPage.cs index abd629fe..970cdad3 100644 --- a/src/Docs/Docs.Logic/CustomMarkdownPage.cs +++ b/src/Docs/Docs.Logic/CustomMarkdownPage.cs @@ -16,7 +16,7 @@ public class CustomMarkdownPage : MarkdownViewBase public override void OnLoad() { Page page; - var pageManager = TryResolve(); + var pageManager = AppHost.TryResolve(); pageManager.PageMap.TryGetValue(MarkdownPage.FilePath, out page); object cat; diff --git a/src/Docs/Docs.Logic/Docs.Logic.csproj b/src/Docs/Docs.Logic/Docs.Logic.csproj index 6634588b..f00c5972 100644 --- a/src/Docs/Docs.Logic/Docs.Logic.csproj +++ b/src/Docs/Docs.Logic/Docs.Logic.csproj @@ -31,20 +31,26 @@ 4 - - ..\..\..\lib\ServiceStack.dll + + ..\..\packages\ServiceStack.3.9.11\lib\net35\ServiceStack.dll - - ..\..\..\lib\ServiceStack.Common.dll + + ..\..\packages\ServiceStack.Common.3.9.11\lib\net35\ServiceStack.Common.dll - - ..\..\..\lib\ServiceStack.Interfaces.dll + + ..\..\packages\ServiceStack.Common.3.9.11\lib\net35\ServiceStack.Interfaces.dll - - ..\..\..\lib\ServiceStack.ServiceInterface.dll + + ..\..\packages\ServiceStack.OrmLite.SqlServer.3.9.9\lib\ServiceStack.OrmLite.SqlServer.dll - - ..\..\..\lib\ServiceStack.Text.dll + + ..\..\packages\ServiceStack.Redis.3.9.11\lib\net35\ServiceStack.Redis.dll + + + ..\..\packages\ServiceStack.3.9.11\lib\net35\ServiceStack.ServiceInterface.dll + + + ..\..\packages\ServiceStack.Text.3.9.11\lib\net35\ServiceStack.Text.dll @@ -63,6 +69,9 @@ + + + - - - -
    - -
    -
    -
    -
    - - - - - - - - - - - - - - + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/RestFiles/RestFiles/default.htm b/src/RestFiles/RestFiles/default.htm index 7d4b4597..b2db4cf5 100644 --- a/src/RestFiles/RestFiles/default.htm +++ b/src/RestFiles/RestFiles/default.htm @@ -1,361 +1,357 @@ - + - REST Files: GitHub-like file access with 1 page jQuery + 1 C# REST Service - - - - + REST Files: GitHub-like file access with 1 page jQuery + 1 C# REST Service + + + + - -ServiceStack Home - -