This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| namespace BrainFuckContinued | |
| { | |
| using System; | |
| using System.Collections.Generic; | |
| class Program | |
| { | |
| static void Main(string[] args) | |
| { | |
| var p = "++++++++++[>+++++++>++++++++++>+++>+<<<<-]>++.>+.+++++++..+++.>++.<<+++++++++++++++.>.+++.------.--------.>+.>."; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public class SampleModule : Nancy.NancyModule | |
| { | |
| public SampleModule() | |
| { | |
| Get["/"] = _ => "Hello World!"; | |
| } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| namespace WebApiModuleHelloWorld | |
| { | |
| public class HelloWorldModule : Superscribe.WebApi.Modules.SuperscribeModule | |
| { | |
| public HelloWorldModule() | |
| { | |
| this.Get["/"] = _ => "Hello World!"; | |
| } | |
| } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using System.Web.Http; | |
| namespace WebApiModuleHelloWorld | |
| { | |
| using Superscribe.WebApi; | |
| public static class WebApiConfig | |
| { | |
| public static void Register(HttpConfiguration config) | |
| { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| namespace WebApiModuleHelloWorld | |
| { | |
| using Superscribe.Models; | |
| public class HelloWorldModule : Superscribe.WebApi.Modules.SuperscribeModule | |
| { | |
| public HelloWorldModule() | |
| { | |
| this.Get["/"] = _ => "Hello World!"; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| namespace WebApiModuleHelloWorld | |
| { | |
| using System; | |
| using Superscribe.Models; | |
| public class HelloWorldModule : Superscribe.WebApi.Modules.SuperscribeModule | |
| { | |
| public HelloWorldModule() | |
| { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| namespace WebApiModuleHelloWorld | |
| { | |
| using System.Net; | |
| public class Product | |
| { | |
| public string Name { get; set; } | |
| public double Price { get; set; } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| this.Post["Products"] = _ => | |
| { | |
| var product = _.Bind<Product>(); | |
| // Save product | |
| return _.Request.CreateResponse( | |
| HttpStatusCode.Created, | |
| new { Link = new { href = string.Format("http://api.localhost/products/{0}", product.Id) } }); | |
| }; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| private static void RegisterServices(IKernel kernel) | |
| { | |
| kernel.Bind<IProductsService>().To<ProductsService>(); | |
| GlobalConfiguration.Configuration.DependencyResolver = new NinjectDependencyResolver(kernel); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| this.Get["Products" / (ʃLong)"Id"] = _ => | |
| { | |
| var service = _.Require<IProductsService>(); | |
| return service.Get(_.Parameters.Id); | |
| }; | |
| this.Post["Products"] = _ => | |
| { | |
| var service = _.Require<IProductsService>(); | |
| var product = _.Bind<Product>(); |