- Wednesday
- 10:20 - "ASP.NET Web API 2: HTTP Services for the Modern Web and Mobile Applications", Dan Roth
- 11:40 - "Scripting your web API development using scriptcs", Glenn Block
- 13:40 - "The missing link – hypermedia in Web API.", Darrel Miller
- 15:00 - "API Client library V2", Darrel Miller
- 16:20 - "ASP.NET and OWIN - Better Together", Dan Roth
- Thursday
- 9:00 - "A deep dive into the ASP.NET Web API runtime architecture", Pedro Felix
- 10:20 - "Pragmatic ASP.NET Web API Solutions - beyond ValuesController", Christian Weyer
- 11:40 - "Securing ASP.NET Web API (v2)", Dominick Baier
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
// definition | |
public static class IdentityServerServiceFactoryExtensions | |
{ | |
public static void Wrap<T>(this IdentityServerServiceFactory fact, | |
Func<T, T> wrapper, | |
Func<IdentityServerServiceFactory,Registration<T>> getter, | |
Action<IdentityServerServiceFactory,Registration<T>> setter) | |
where T: class | |
{ | |
fact.Register(new HelperRegistration<T>(getter(fact), GetRegistrationNameFor(typeof(T)))); |
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; | |
using System.Net; | |
using System.Net.Security; | |
using System.Security.Cryptography.X509Certificates; | |
using Xunit; | |
namespace CertificateValidationAndConnections | |
{ | |
public class CertificateValidationAndConnectionsFacts | |
{ |
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
// based on http://www.asp.net/web-api/overview/formats-and-model-binding/parameter-binding-in-aspnet-web-api | |
// and http://blogs.msdn.com/b/jmstall/archive/2012/04/20/how-to-bind-to-custom-objects-in-action-signatures-in-mvc-webapi.aspx | |
public class Can_use_TypeConverter_to_handle_simple_values | |
{ | |
[TypeConverter(typeof(LocationTypeConverter))] | |
public class Location | |
{ | |
public double Latitude { get; set; } | |
public double Longitude { 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
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Net; | |
using System.Net.Http; | |
using System.Web.Http; | |
using System.Web.Http.Routing; | |
namespace Drum.Example.Controllers | |
{ |
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
var config = new HttpConfiguration(); | |
var builder = new ContainerBuilder(); | |
foreach (var type in config.Services | |
.GetHttpControllerSelector() | |
.GetControllerMapping().Select(p => p.Value.ControllerType)) | |
{ | |
builder.RegisterType(type); | |
} |
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 ParentChildController : ApiController | |
{ | |
public string Get(int pid, int cid) | |
{ | |
return string.Format("{0}:{1}",pid,cid); | |
} | |
} | |
class ParentChildRoutingTranslator : DelegatingHandler | |
{ |
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
---- | |
HTTP/1.1 401 Unauthorized | |
... | |
WWW-Authenticate: Basic realm="Web API Book" | |
... | |
---- | |
---- | |
GET /resource HTTP/1.1 |
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; | |
using System.Collections.Generic; | |
using System.IO; | |
using System.Linq; | |
using System.Text; | |
using System.Threading.Tasks; | |
using Microsoft.Owin; | |
using Microsoft.Owin.Security; | |
using Microsoft.Owin.Security.Infrastructure; | |
using Owin; |
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
[Fact] | |
public async Task Fact() | |
{ | |
await OwinTester.Run( | |
useConfiguration: app => | |
{ | |
app.UseBasicAuthentication(Options); | |
}, | |
useRequest: () => | |
{ |