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

2,858 views
2,615 views

Published on

More info on http://www.techdays.be

0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
2,858
On SlideShare
0
From Embeds
0
Number of Embeds
2
Actions
Shares
0
Downloads
61
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

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

  1. 1. ASP.NET Web APIJim Wang
  2. 2. How to reach more clients?
  3. 3. How to make it scale?
  4. 4. How to keep it simple?
  5. 5. Leverage the Web – build Web APIs
  6. 6. ASP.NET Web API A framework for creating HTTP services that can reach a broad range of clients including browsers and mobile devices
  7. 7. 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+
  8. 8. ASP.NET Web API ODataComponents for implementing OData servicesModel builders, formatters (Atom/JSON/XML), path and query parsers, LINQ expression generator, etcSupport common patterns using an open protocolEx. query, paging, relationships, metadataBuilt on ODataLibSame underpinnings as WCF Data ServicesOpen source and accepting contributionshttp://aspnetwebstack.codeplex.com
  9. 9. Three Steps to Get StartedCreate 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> {...}
  10. 10. Data Model for ODataThe ASP.NET Web API core runtime has no datamodelObjects formatted to/from opaque blobs by formattersOData is based on the Entity Data Model (EDM)Entity sets, entities, relationships, complex types, actions, functionsHaving a data model means the framework can domore for youProvide metadata, setup routes, rich link generation, query, pagingYour OData EDM can be different from your EFEDM
  11. 11. Query Support[Queryable] action filter enables OData querysupportCan be used independent of the formatODataQueryOptions provides the parsed queryASTApply the query to an IQueryableTranslate the Abstract Syntax Tree to your query mechanism of choiceQuery validationRestrict supported query options, functions, expression operators, queryable properties, etc.PagingSet PageSize to your desired max page size
  12. 12. what’s next? Security with OAuth2, JWT OData $expand, $select Odata scaffolding for templates SignalR integration CORS, JSONP
  13. 13. signalRJim Wang
  14. 14. what is it?SignalR : Incredibly simple real-time for ASP.NET Automatic protocol negotiation Simplicity Reach Performance
  15. 15. where are we?github.com/SignalR/SignalR1.0 RTW with ASP.NET 2012.2
  16. 16. clientsToday 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  …
  17. 17. what’s next? Monthly point releases More documentation and samples More templates and scaffolding Scale out  Service Bus  SQL Server  Redis
  18. 18. knockout.jsJim Wang
  19. 19. features
  20. 20. let’s build.Jim Wang
  21. 21. get ASP.NET and Web Tools 2012.2www.asp.net/vnext
  22. 22. linksKnockout.jshttp://knockoutjs.comBootstraphttp://twitter.github.com/bootstrap/OData Security Guidance for Web APIhttp://www.asp.net/web-api/overview/odata-support-in-aspnet-web-api/odata-security-guidance
  23. 23. questions?Jim Wang@turanukjim.wang@microsoft.com

×