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 OwinModulesHelloWorld | |
| { | |
| using Owin; | |
| using Superscribe.Owin; | |
| public class Startup | |
| { | |
| public void Configuration(IAppBuilder app) | |
| { |
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
| <?xml version="1.0"?> | |
| <configuration> | |
| <system.web> | |
| <compilation debug="true" targetFramework="4.5" /> | |
| <httpRuntime targetFramework="4.5" /> | |
| </system.web> | |
| <appSettings> | |
| <add key="owin:HandleAllRequests" value="true" /> | |
| <add key="owin:SetCurrentDirectory" value="true" /> | |
| </appSettings> |
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 OwinModulesHelloWorld | |
| { | |
| using Superscribe.Owin; | |
| public class HelloWorldModule : SuperscribeOwinModule | |
| { | |
| public HelloWorldModule() | |
| { | |
| this.Get["/"] = _ => "Hello world - OWIN style"; | |
| } |
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 OwinModulesHelloWorld | |
| { | |
| using System.IO; | |
| using Newtonsoft.Json; | |
| using Owin; | |
| using Superscribe.Owin; | |
| public class Startup | |
| { | |
| public void Configuration(IAppBuilder app) |
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 OwinModulesHelloWorld | |
| { | |
| using Superscribe.Owin; | |
| public class HelloWorldModule : SuperscribeOwinModule | |
| { | |
| public HelloWorldModule() | |
| { | |
| this.Get["/"] = _ => "Hello world - OWIN style"; |
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>(); | |
| _.StatusCode = 201; | |
| return new { Message = string.Format("Received product {0}", product.Name) }; | |
| }; |
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 OwinModulesHelloWorld | |
| { | |
| public class Product | |
| { | |
| public int Id { get; set; } | |
| 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
| public class IndividualResult<T> { | |
| public bool WasCalculated { get; set; } | |
| public T Result { get; set; } | |
| } | |
| public class CalculatesThings { | |
| private PropertyACalculator<AType> propertyACalculator; | |
| private PropertyBCalculator<BType> propertyBCalculator; | |
| private PropertyCCalculator<CType> propertyCCalculator; |
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
| CacheControlHeaderProvider = (request, cfg) => | |
| { | |
| var matcher = new Regex("/Api/Notifications"); | |
| if (matcher.IsMatch(request.RequestUri.ToString())) | |
| { | |
| return null; | |
| } | |
| return new CacheControlHeaderValue | |
| { |
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 MailController : ApiController | |
| { | |
| private readonly dynamic[] mail = | |
| { | |
| new { Id = 1, Location = "Inbox", Subject = "value1" }, | |
| new { Id = 2, Location = "Inbox", Subject = "value2" }, | |
| new { Id = 3, Location = "Inbox", Subject = "value3" }, | |
| new { Id = 4, Location = "Deleted", Subject = "value4" }, | |
| new { Id = 5, Location = "Sent", Subject = "value5" } | |
| }; |