ASP.NET Web API Jim Wang
How to reach more clients?
How to make it scale?
How to keep it simple?
Leverage the Web – build Web APIs
ASP.NET Web API A framework for creating HTTP services that can reach a broad range of clients including browsers and mobile devices
features  First class modern HTTP  Available as NuGet packages programming model  Great templates and tooling in  Easily map resources to URIs 2012.2 release, like help pages  Content negotiation  Fully open source  Request validation  Flexible hosting  Lightweight  .NET 4+
ASP.NET Web API OData Components for implementing OData services Model builders, formatters (Atom/JSON/XML), path and query parsers, LINQ expression generator, etc Support common patterns using an open protocol Ex. query, paging, relationships, metadata Built on ODataLib Same underpinnings as WCF Data Services Open source and accepting contributions http://aspnetwebstack.codeplex.com
Three Steps to Get Started Create your EDM ODataConventionModelBuilder modelBuilder = new ODataConventionModelBuilder(); modelBuilder.EntitySet<Movie>("Movies"); IEdmModel model = modelBuilder.GetEdmModel(); Configure your OData Route config.Routes.MapODataRoute(routeName: "OData", routePrefix: "odata", model: model); Implement an OData Controller public class MoviesController : EntitySetController<Movie, int> {...}
Data Model for OData The ASP.NET Web API core runtime has no data model Objects formatted to/from opaque blobs by formatters OData is based on the Entity Data Model (EDM) Entity sets, entities, relationships, complex types, actions, functions Having a data model means the framework can do more for you Provide metadata, setup routes, rich link generation, query, paging Your OData EDM can be different from your EF EDM
Query Support [Queryable] action filter enables OData query support Can be used independent of the format ODataQueryOptions provides the parsed query AST Apply the query to an IQueryable Translate the Abstract Syntax Tree to your query mechanism of choice Query validation Restrict supported query options, functions, expression operators, queryable properties, etc. Paging Set PageSize to your desired max page size
what’s next?  Security with OAuth2, JWT  OData $expand, $select  Odata scaffolding for templates  SignalR integration  CORS, JSONP
signalR Jim Wang
what is it? SignalR : Incredibly simple real-time for ASP.NET  Automatic protocol negotiation Simplicity Reach Performance
where are we? github.com/SignalR/SignalR 1.0 RTW with ASP.NET 2012.2
clients Today Future?  jQuery  Pure JavaScript (no jQuery)  .NET 4.0+  C++ (Windows Store & Embedded)  Silverlight 5  MonoTouch/MonoDroid  Windows Phone 8  Objective C  .NET for Windows Store apps  Java  …
what’s next?  Monthly point releases  More documentation and samples  More templates and scaffolding  Scale out  Service Bus  SQL Server  Redis
knockout.js Jim Wang
features
let’s build. Jim Wang
get ASP.NET and Web Tools 2012.2 www.asp.net/vnext
links Knockout.js http://knockoutjs.com Bootstrap http://twitter.github.com/bootstrap/ OData Security Guidance for Web API http://www.asp.net/web-api/overview/odata-support-in-aspnet-web-api/odata-security-guidance
questions? Jim Wang @turanuk jim.wang@microsoft.com

Real-Time Web Applications with ASP.NET WebAPI and SignalR

  • 2.
  • 3.
    How to reachmore clients?
  • 4.
    How to makeit scale?
  • 5.
    How to keepit simple?
  • 6.
    Leverage the Web– build Web APIs
  • 7.
    ASP.NET Web API A framework for creating HTTP services that can reach a broad range of clients including browsers and mobile devices
  • 8.
    features  First classmodern HTTP  Available as NuGet packages programming model  Great templates and tooling in  Easily map resources to URIs 2012.2 release, like help pages  Content negotiation  Fully open source  Request validation  Flexible hosting  Lightweight  .NET 4+
  • 9.
    ASP.NET Web APIOData Components for implementing OData services Model builders, formatters (Atom/JSON/XML), path and query parsers, LINQ expression generator, etc Support common patterns using an open protocol Ex. query, paging, relationships, metadata Built on ODataLib Same underpinnings as WCF Data Services Open source and accepting contributions http://aspnetwebstack.codeplex.com
  • 10.
    Three Steps toGet Started Create your EDM ODataConventionModelBuilder modelBuilder = new ODataConventionModelBuilder(); modelBuilder.EntitySet<Movie>("Movies"); IEdmModel model = modelBuilder.GetEdmModel(); Configure your OData Route config.Routes.MapODataRoute(routeName: "OData", routePrefix: "odata", model: model); Implement an OData Controller public class MoviesController : EntitySetController<Movie, int> {...}
  • 11.
    Data Model forOData The ASP.NET Web API core runtime has no data model Objects formatted to/from opaque blobs by formatters OData is based on the Entity Data Model (EDM) Entity sets, entities, relationships, complex types, actions, functions Having a data model means the framework can do more for you Provide metadata, setup routes, rich link generation, query, paging Your OData EDM can be different from your EF EDM
  • 12.
    Query Support [Queryable] actionfilter enables OData query support Can be used independent of the format ODataQueryOptions provides the parsed query AST Apply the query to an IQueryable Translate the Abstract Syntax Tree to your query mechanism of choice Query validation Restrict supported query options, functions, expression operators, queryable properties, etc. Paging Set PageSize to your desired max page size
  • 13.
    what’s next?  Security with OAuth2, JWT  OData $expand, $select  Odata scaffolding for templates  SignalR integration  CORS, JSONP
  • 14.
  • 15.
    what is it? SignalR: Incredibly simple real-time for ASP.NET  Automatic protocol negotiation Simplicity Reach Performance
  • 16.
  • 17.
    clients Today Future?  jQuery  Pure JavaScript (no jQuery)  .NET 4.0+  C++ (Windows Store & Embedded)  Silverlight 5  MonoTouch/MonoDroid  Windows Phone 8  Objective C  .NET for Windows Store apps  Java  …
  • 18.
    what’s next?  Monthly point releases  More documentation and samples  More templates and scaffolding  Scale out  Service Bus  SQL Server  Redis
  • 19.
  • 20.
  • 21.
  • 22.
    get ASP.NET andWeb Tools 2012.2 www.asp.net/vnext
  • 23.
    links Knockout.js http://knockoutjs.com Bootstrap http://twitter.github.com/bootstrap/ OData Security Guidancefor Web API http://www.asp.net/web-api/overview/odata-support-in-aspnet-web-api/odata-security-guidance
  • 24.