SlideShare una empresa de Scribd logo
1 de 27
Desarrollando para dispositivos Móviles con
2
W3C HTML Working Group
•
•
•
•
•
First Public
Working Draft
Working Draft Last Call
Candidate
Recommendation
Recommendation
Site Ready
HTML5
El enfoque de Microsoft a HTML5
Under Development
Features
Emerging Standards
beautyoftheweb.com ietestdrive.com html5labs.com
IE9 IE Platform Previews HTML5 Labs
HTML5
• New Markup Elements
• Canvas
• Audio
• Video
• Local Storage
• Cross-Window
Messaging
• Text Selection APIs
• Parsing SVG in HTML
CSS3
• 2D Transforms
• Border Radius
• Box-Shadow
• Fonts (WOFF)
• Media Queries
• Multiple Backgrounds
• Namespaces
• Opacity
• rgba(), hsl(), hsla()
• Selectors (IE8)
SVG
• Shapes
• Clipping, Masking, and
Compositing
• Transforms
• Extensibility
• Gradients
• Interactivity
• Linking and Views
• Painting and Colors
• Paths
• Text
Others
• ECMA Script 5 (all but Strict
Mode)
• Native JSON support (IE8)
• Performance API
• Geo-Location
• Data-uri (IE8)
• DOM L2, L3
• Selectors API L2
• AJAX Navigation (IE8)
• DOMParser and
XMLSerializer
• ICC v2 and Color Profile
• ARIA
http://bit.ly/IE9Guide
Hardware Acceleration
HTML5 en IE10 Platform Previews
HTML5
• Drag&Drop
• File API
• Forms Validation
• Sandbox
• Web Workers
• Web Sockets
• Async
• AppCache
CSS3
• Grid
• Flexbox
• Gradient
• Multi-Column
• Floats
• Transforms
• Animations
• Gradients
• Transitions
Others
• Web Performance APIs
• ECMA Script 5 Strict
Mode
• Advanced Hit Testing
APIs
• Media Queries
Listeners
• Removal of Style Sheet
Limits
http://bit.ly/IE10Guide
File ->
New Project
Bundling y Minification
Bundling y Minification
Mejora la performance de carga de JavaScript y CSS
Reduciendo # y tamaño de requests HTTP
Funciona por convención (no requiere configuración)
Totalmente adaptable y extensible
Bundling and Minification
Bundling &
Minification
<script src=”@Url.Content(“~/Scripts/Site.js”)”></script>
<script src=”~/Scripts/Site.js”></script>
@{
string myClass = null;
if (someCondition) {
myClass = ”shinyFancy”;
}
}
<div @{if (myClass != null) { <text>class=”@myClass”</text> } }>Content</div>
@{
string myClass = null;
if (someCondition) {
myClass = ”shinyFancy”;
}
}
<div class=”@myClass”>Content</div>
Mobile web con ASP.NET MVC 4
Adaptive Rendering
Vía CSS Media Queries
Display Modes
Vistas adaptadas por dispositivos
Mobile Template
Utilizando jQuery.Mobile
Adaptive
Rendering
Display Modes Mobile Template
Mobile Web con
ASP.NET MVC 4
Asynchronous Support
Porque async en el server?
Porque nos permite usar de manera mas eficiente los recurso del Server
Y como funciona?
Al momento de invocar a un resource remoto, el controller le cede el control permitiendole reutilizar el
thread mientras espera la respuesta.
Cuando la llamada remota se completa, el controller es re-scheduleado para completar su ejecución.
Menor # de threads corriendo -> aumenta la escalabilidad
El uso de async en el servicio no se expone a
browsers/clientes
http://myserver.com/products -> la misma URL puede ser implementada en ASP.NET usando un
controller sincrónico o asincronico.
public class Products : AsyncController {
public void IndexAsync() {
WebClient wc1 = new WebClient();
AsyncManager.OutstandingOperations.Increment();
wc1.DownloadStringCompleted += (sender, e) => {
AsyncManager.Parameters[“result"] = e.Result;
AsyncManager.OutstandingOperations.Decrement();
};
wc1.DownloadStringAsync(new Uri("http://www.bing.com/"));
}
public ActionResult IndexCompleted(string result) {
return View();
}
}
public class Products : Controller {
public async Task<ActionResult> IndexAsync() {
WebClient web = new WebClient();
string result = await web.DownloadStringTaskAsync("www.bing.com/");
return View();
}
}

Más contenido relacionado

La actualidad más candente

La actualidad más candente (11)

Desarrollo simple con Webmatrix
Desarrollo simple con WebmatrixDesarrollo simple con Webmatrix
Desarrollo simple con Webmatrix
 
Shadows of the browser
Shadows of the browserShadows of the browser
Shadows of the browser
 
Web matrix. armando nuestros sitios dinámicamente con html5, php y mysql
Web matrix.  armando nuestros sitios dinámicamente con html5, php y mysqlWeb matrix.  armando nuestros sitios dinámicamente con html5, php y mysql
Web matrix. armando nuestros sitios dinámicamente con html5, php y mysql
 
Nuxt Avanzado (de Scaffolding a MVP)
Nuxt Avanzado (de Scaffolding a MVP)Nuxt Avanzado (de Scaffolding a MVP)
Nuxt Avanzado (de Scaffolding a MVP)
 
Msdn Te Invita A Ser Parte De UXity
Msdn Te Invita A Ser Parte De UXityMsdn Te Invita A Ser Parte De UXity
Msdn Te Invita A Ser Parte De UXity
 
Magento creador de tiendas virtuales
Magento creador de tiendas virtualesMagento creador de tiendas virtuales
Magento creador de tiendas virtuales
 
Presentación Curso Diseño y Desarrollo Web Avanzado
Presentación Curso Diseño y Desarrollo Web AvanzadoPresentación Curso Diseño y Desarrollo Web Avanzado
Presentación Curso Diseño y Desarrollo Web Avanzado
 
HTML5 en Acción
HTML5 en AcciónHTML5 en Acción
HTML5 en Acción
 
Inmersión a HTML5
Inmersión a HTML5Inmersión a HTML5
Inmersión a HTML5
 
Azure 360º para Desarrolaldores
Azure 360º para DesarrolaldoresAzure 360º para Desarrolaldores
Azure 360º para Desarrolaldores
 
Todomir
TodomirTodomir
Todomir
 

Destacado

A guide on how to tackle flexible working
A guide on how to tackle flexible workingA guide on how to tackle flexible working
A guide on how to tackle flexible workingakimalvora
 
Aplicativos híbridos e o Apache Cordova
Aplicativos híbridos e o Apache CordovaAplicativos híbridos e o Apache Cordova
Aplicativos híbridos e o Apache CordovaWennder Santos
 
Capítulo 3 los numeros, ser, estar
Capítulo 3 los numeros, ser, estarCapítulo 3 los numeros, ser, estar
Capítulo 3 los numeros, ser, estarProf R
 
Aplicativos híbridos e Xamarin Test Cloud
Aplicativos híbridos e Xamarin Test CloudAplicativos híbridos e Xamarin Test Cloud
Aplicativos híbridos e Xamarin Test CloudWennder Santos
 
Presentación fase 1 ¡Apúntate!
Presentación fase 1 ¡Apúntate!Presentación fase 1 ¡Apúntate!
Presentación fase 1 ¡Apúntate!Centro Capi Tejuela
 
TEDex - Responsibility Process
TEDex - Responsibility ProcessTEDex - Responsibility Process
TEDex - Responsibility ProcessJose Guedes
 
Contribuição do as para a justiça na área da infância e juventude
Contribuição do as para a justiça na área da infância e juventudeContribuição do as para a justiça na área da infância e juventude
Contribuição do as para a justiça na área da infância e juventudeRosane Domingues
 
Vatika Saç Bakım Ürünleri
Vatika Saç Bakım ÜrünleriVatika Saç Bakım Ürünleri
Vatika Saç Bakım ÜrünleriHobi Kozmetik
 
Professional Indemnity Insurance Ultimate Guide
 Professional Indemnity Insurance Ultimate Guide Professional Indemnity Insurance Ultimate Guide
Professional Indemnity Insurance Ultimate Guideakimalvora
 
Unraveling the shift to the entrepreneurial economy
Unraveling the shift to the entrepreneurial economyUnraveling the shift to the entrepreneurial economy
Unraveling the shift to the entrepreneurial economyErik Stam
 

Destacado (16)

Visual Studio LightSwitch
Visual Studio LightSwitchVisual Studio LightSwitch
Visual Studio LightSwitch
 
A guide on how to tackle flexible working
A guide on how to tackle flexible workingA guide on how to tackle flexible working
A guide on how to tackle flexible working
 
Aplicativos híbridos e o Apache Cordova
Aplicativos híbridos e o Apache CordovaAplicativos híbridos e o Apache Cordova
Aplicativos híbridos e o Apache Cordova
 
Capítulo 3 los numeros, ser, estar
Capítulo 3 los numeros, ser, estarCapítulo 3 los numeros, ser, estar
Capítulo 3 los numeros, ser, estar
 
Aplicativos híbridos e Xamarin Test Cloud
Aplicativos híbridos e Xamarin Test CloudAplicativos híbridos e Xamarin Test Cloud
Aplicativos híbridos e Xamarin Test Cloud
 
Presentación fase 1 ¡Apúntate!
Presentación fase 1 ¡Apúntate!Presentación fase 1 ¡Apúntate!
Presentación fase 1 ¡Apúntate!
 
La Estrella
La EstrellaLa Estrella
La Estrella
 
TEDex - Responsibility Process
TEDex - Responsibility ProcessTEDex - Responsibility Process
TEDex - Responsibility Process
 
Contribuição do as para a justiça na área da infância e juventude
Contribuição do as para a justiça na área da infância e juventudeContribuição do as para a justiça na área da infância e juventude
Contribuição do as para a justiça na área da infância e juventude
 
Nestlé
NestléNestlé
Nestlé
 
Vatika Saç Bakım Ürünleri
Vatika Saç Bakım ÜrünleriVatika Saç Bakım Ürünleri
Vatika Saç Bakım Ürünleri
 
Exercicios
ExerciciosExercicios
Exercicios
 
Sterling catalog
Sterling catalogSterling catalog
Sterling catalog
 
La Princesita
La PrincesitaLa Princesita
La Princesita
 
Professional Indemnity Insurance Ultimate Guide
 Professional Indemnity Insurance Ultimate Guide Professional Indemnity Insurance Ultimate Guide
Professional Indemnity Insurance Ultimate Guide
 
Unraveling the shift to the entrepreneurial economy
Unraveling the shift to the entrepreneurial economyUnraveling the shift to the entrepreneurial economy
Unraveling the shift to the entrepreneurial economy
 

Similar a Desarrollando para dispositivos móviles con ASP.NET MVC 4

Desarrollo de aplicaciones con HTML5
Desarrollo de aplicaciones con HTML5 Desarrollo de aplicaciones con HTML5
Desarrollo de aplicaciones con HTML5 Gonzalo C.
 
Aplicaciones en HTML 5: Los pilares de una Nueva Web
Aplicaciones en HTML 5: Los pilares de una Nueva WebAplicaciones en HTML 5: Los pilares de una Nueva Web
Aplicaciones en HTML 5: Los pilares de una Nueva WebGonzalo C.
 
Html5 y otras yerbas
Html5 y otras yerbasHtml5 y otras yerbas
Html5 y otras yerbasPeter Concha
 
Html5 y otras yerbas
Html5 y otras yerbasHtml5 y otras yerbas
Html5 y otras yerbasAvanet
 
Html5 - El futuro de la web
Html5 - El futuro de la webHtml5 - El futuro de la web
Html5 - El futuro de la webJoan Fernández
 
Nativescript
NativescriptNativescript
NativescriptAutentia
 
Aplicaciones móviles super-escalables
Aplicaciones móviles super-escalablesAplicaciones móviles super-escalables
Aplicaciones móviles super-escalablesSergio Borromei
 
Seminario html5
Seminario html5Seminario html5
Seminario html5UDECI
 
Lecciones aprendidas creando una red social
Lecciones aprendidas creando una red socialLecciones aprendidas creando una red social
Lecciones aprendidas creando una red socialRoberto Luis Bisbé
 
Webinar interlat apps_2012_carlos_a-perez_españa
Webinar interlat apps_2012_carlos_a-perez_españaWebinar interlat apps_2012_carlos_a-perez_españa
Webinar interlat apps_2012_carlos_a-perez_españaJerilee Dueñas Rengifo
 
Webinar interlat apps_2012_carlos_a-perez_españa
Webinar interlat apps_2012_carlos_a-perez_españaWebinar interlat apps_2012_carlos_a-perez_españa
Webinar interlat apps_2012_carlos_a-perez_españaCommunity Managers Latam
 
APPS Aplicaciones móviles: Construyendo y publicando nuestro primera APPS mul...
APPS Aplicaciones móviles: Construyendo y publicando nuestro primera APPS mul...APPS Aplicaciones móviles: Construyendo y publicando nuestro primera APPS mul...
APPS Aplicaciones móviles: Construyendo y publicando nuestro primera APPS mul...Interlat
 

Similar a Desarrollando para dispositivos móviles con ASP.NET MVC 4 (20)

Desarrollo de aplicaciones con HTML5
Desarrollo de aplicaciones con HTML5 Desarrollo de aplicaciones con HTML5
Desarrollo de aplicaciones con HTML5
 
Aplicaciones en HTML 5: Los pilares de una Nueva Web
Aplicaciones en HTML 5: Los pilares de una Nueva WebAplicaciones en HTML 5: Los pilares de una Nueva Web
Aplicaciones en HTML 5: Los pilares de una Nueva Web
 
Html5 y otras yerbas
Html5 y otras yerbasHtml5 y otras yerbas
Html5 y otras yerbas
 
Html5 y otras yerbas
Html5 y otras yerbasHtml5 y otras yerbas
Html5 y otras yerbas
 
ASP.NET MVC Workshop Día 3
ASP.NET MVC Workshop Día 3ASP.NET MVC Workshop Día 3
ASP.NET MVC Workshop Día 3
 
ASP.NET MVC
ASP.NET MVCASP.NET MVC
ASP.NET MVC
 
Arquitectura
Arquitectura Arquitectura
Arquitectura
 
Html5 - El futuro de la web
Html5 - El futuro de la webHtml5 - El futuro de la web
Html5 - El futuro de la web
 
Nativescript
NativescriptNativescript
Nativescript
 
Tecnologíahtml5
Tecnologíahtml5Tecnologíahtml5
Tecnologíahtml5
 
Web2 Quiensomos
Web2 QuiensomosWeb2 Quiensomos
Web2 Quiensomos
 
El Nuevo Internet Explorer 9
El Nuevo Internet Explorer 9El Nuevo Internet Explorer 9
El Nuevo Internet Explorer 9
 
Aplicaciones móviles super-escalables
Aplicaciones móviles super-escalablesAplicaciones móviles super-escalables
Aplicaciones móviles super-escalables
 
Seminario html5
Seminario html5Seminario html5
Seminario html5
 
Lecciones aprendidas creando una red social
Lecciones aprendidas creando una red socialLecciones aprendidas creando una red social
Lecciones aprendidas creando una red social
 
[Code Camp 2009] Desarrollando sitios web escalables con ASP.NET MVC (Rodolfo...
[Code Camp 2009] Desarrollando sitios web escalables con ASP.NET MVC (Rodolfo...[Code Camp 2009] Desarrollando sitios web escalables con ASP.NET MVC (Rodolfo...
[Code Camp 2009] Desarrollando sitios web escalables con ASP.NET MVC (Rodolfo...
 
Full-stack JavaScript: Desarrollo integral de aplicaciones Web con JavaScript
Full-stack JavaScript: Desarrollo integral de aplicaciones Web con JavaScriptFull-stack JavaScript: Desarrollo integral de aplicaciones Web con JavaScript
Full-stack JavaScript: Desarrollo integral de aplicaciones Web con JavaScript
 
Webinar interlat apps_2012_carlos_a-perez_españa
Webinar interlat apps_2012_carlos_a-perez_españaWebinar interlat apps_2012_carlos_a-perez_españa
Webinar interlat apps_2012_carlos_a-perez_españa
 
Webinar interlat apps_2012_carlos_a-perez_españa
Webinar interlat apps_2012_carlos_a-perez_españaWebinar interlat apps_2012_carlos_a-perez_españa
Webinar interlat apps_2012_carlos_a-perez_españa
 
APPS Aplicaciones móviles: Construyendo y publicando nuestro primera APPS mul...
APPS Aplicaciones móviles: Construyendo y publicando nuestro primera APPS mul...APPS Aplicaciones móviles: Construyendo y publicando nuestro primera APPS mul...
APPS Aplicaciones móviles: Construyendo y publicando nuestro primera APPS mul...
 

Más de Mariano Sánchez

Más de Mariano Sánchez (17)

.NET Core
.NET Core.NET Core
.NET Core
 
ASP.NET Core 1.0
ASP.NET Core 1.0ASP.NET Core 1.0
ASP.NET Core 1.0
 
Introducción a SignalR
Introducción a SignalRIntroducción a SignalR
Introducción a SignalR
 
Hey Cortana!
Hey Cortana!Hey Cortana!
Hey Cortana!
 
Developing Universal Apps for Windows
Developing Universal Apps for WindowsDeveloping Universal Apps for Windows
Developing Universal Apps for Windows
 
Introducing the Windows Phone 8.1 App Development Platform
Introducing the Windows Phone 8.1 App Development PlatformIntroducing the Windows Phone 8.1 App Development Platform
Introducing the Windows Phone 8.1 App Development Platform
 
Visual Studio Online
Visual Studio OnlineVisual Studio Online
Visual Studio Online
 
Patrones Grasp
Patrones GraspPatrones Grasp
Patrones Grasp
 
Patrones de Diseño
Patrones de DiseñoPatrones de Diseño
Patrones de Diseño
 
Introducción a DDD
Introducción a DDDIntroducción a DDD
Introducción a DDD
 
Conociendo TypeScript
Conociendo TypeScriptConociendo TypeScript
Conociendo TypeScript
 
C# 6 - Que hay de nuevo?
C# 6 - Que hay de nuevo?C# 6 - Que hay de nuevo?
C# 6 - Que hay de nuevo?
 
Universal Windows Platform Programando para todos y todas
Universal Windows PlatformProgramando para todos y todasUniversal Windows PlatformProgramando para todos y todas
Universal Windows Platform Programando para todos y todas
 
Code Smells
Code SmellsCode Smells
Code Smells
 
Introducción a LINQ
Introducción a LINQIntroducción a LINQ
Introducción a LINQ
 
Refactoring - Mejorando el diseño del código existente
Refactoring - Mejorando el diseño del código existenteRefactoring - Mejorando el diseño del código existente
Refactoring - Mejorando el diseño del código existente
 
Patrones de Diseño
Patrones de DiseñoPatrones de Diseño
Patrones de Diseño
 

Desarrollando para dispositivos móviles con ASP.NET MVC 4

  • 2. 2
  • 3. W3C HTML Working Group • • • • •
  • 4.
  • 5. First Public Working Draft Working Draft Last Call Candidate Recommendation Recommendation
  • 6. Site Ready HTML5 El enfoque de Microsoft a HTML5 Under Development Features Emerging Standards beautyoftheweb.com ietestdrive.com html5labs.com IE9 IE Platform Previews HTML5 Labs
  • 7. HTML5 • New Markup Elements • Canvas • Audio • Video • Local Storage • Cross-Window Messaging • Text Selection APIs • Parsing SVG in HTML CSS3 • 2D Transforms • Border Radius • Box-Shadow • Fonts (WOFF) • Media Queries • Multiple Backgrounds • Namespaces • Opacity • rgba(), hsl(), hsla() • Selectors (IE8) SVG • Shapes • Clipping, Masking, and Compositing • Transforms • Extensibility • Gradients • Interactivity • Linking and Views • Painting and Colors • Paths • Text Others • ECMA Script 5 (all but Strict Mode) • Native JSON support (IE8) • Performance API • Geo-Location • Data-uri (IE8) • DOM L2, L3 • Selectors API L2 • AJAX Navigation (IE8) • DOMParser and XMLSerializer • ICC v2 and Color Profile • ARIA http://bit.ly/IE9Guide Hardware Acceleration
  • 8. HTML5 en IE10 Platform Previews HTML5 • Drag&Drop • File API • Forms Validation • Sandbox • Web Workers • Web Sockets • Async • AppCache CSS3 • Grid • Flexbox • Gradient • Multi-Column • Floats • Transforms • Animations • Gradients • Transitions Others • Web Performance APIs • ECMA Script 5 Strict Mode • Advanced Hit Testing APIs • Media Queries Listeners • Removal of Style Sheet Limits http://bit.ly/IE10Guide
  • 9.
  • 10.
  • 11.
  • 12.
  • 15. Bundling y Minification Mejora la performance de carga de JavaScript y CSS Reduciendo # y tamaño de requests HTTP Funciona por convención (no requiere configuración) Totalmente adaptable y extensible
  • 19. @{ string myClass = null; if (someCondition) { myClass = ”shinyFancy”; } } <div @{if (myClass != null) { <text>class=”@myClass”</text> } }>Content</div>
  • 20. @{ string myClass = null; if (someCondition) { myClass = ”shinyFancy”; } } <div class=”@myClass”>Content</div>
  • 21.
  • 22. Mobile web con ASP.NET MVC 4 Adaptive Rendering Vía CSS Media Queries Display Modes Vistas adaptadas por dispositivos Mobile Template Utilizando jQuery.Mobile Adaptive Rendering Display Modes Mobile Template
  • 24.
  • 25. Asynchronous Support Porque async en el server? Porque nos permite usar de manera mas eficiente los recurso del Server Y como funciona? Al momento de invocar a un resource remoto, el controller le cede el control permitiendole reutilizar el thread mientras espera la respuesta. Cuando la llamada remota se completa, el controller es re-scheduleado para completar su ejecución. Menor # de threads corriendo -> aumenta la escalabilidad El uso de async en el servicio no se expone a browsers/clientes http://myserver.com/products -> la misma URL puede ser implementada en ASP.NET usando un controller sincrónico o asincronico.
  • 26. public class Products : AsyncController { public void IndexAsync() { WebClient wc1 = new WebClient(); AsyncManager.OutstandingOperations.Increment(); wc1.DownloadStringCompleted += (sender, e) => { AsyncManager.Parameters[“result"] = e.Result; AsyncManager.OutstandingOperations.Decrement(); }; wc1.DownloadStringAsync(new Uri("http://www.bing.com/")); } public ActionResult IndexCompleted(string result) { return View(); } }
  • 27. public class Products : Controller { public async Task<ActionResult> IndexAsync() { WebClient web = new WebClient(); string result = await web.DownloadStringTaskAsync("www.bing.com/"); return View(); } }

Notas del editor

  1. Microsoft is actively engaged with three large standards organizations: W3C, IETF and ECMA International. Each organization is divided into Working Groups.
  2. Taking the HTML5 Working Group as an example, Paul Cotton (Microsoft Corp) is a co-chair of the group – we’ve been leading this space for many years! In addition to Paul, more than 16 people from Microsoft are working just on this working group – plus many others involved in other WGs.
  3. Building a standard is like planning a building. You go through different steps and it’s important to plan all levels carefully – or you risk to hit issues along the road.
  4. Microsoft has three channels: IE9 is all about “Site Ready HTML5”. It’s based on a stable and interoperable implementation of HTML5. It offers the best experience to Windows users, thanks to the native hardware acceleration support. IE Platform Previews focus on under development features. With PP, we wanted to be transparent with the community over the internal progress – allowing them to provide feedbacks and us to act on these feedbacks HTML5 Labs are about emerging standards that still require more time and further analysis before they can be safely and interoperably adopted across browsers.
  5. List of the main (not all!) HTML5 features supported in IE9. More info at: http://bit.ly/IE9Guide
  6. List of the main (not all!) HTML5 features supported in IE10. More info at: http://bit.ly/IE10Guide
  7. At this point, there should be no doubt that Microsoft is seriously committed to HTML5. Today you can start building HTML5 applications on top of IE9, leveraging the hardware acceleration and the integration with Windows 7. With Mango, (the same!) IE9 will be available to Windows Phone 7 devices. On Windows 8, you will be able to build Windows applications using HTML5 and JavaScript. Come to the Build conference (www.buildwindows.com) in September to learn more about the new exciting Windows8 platform.
  8. At this point, there should be no doubt that Microsoft is seriously committed to HTML5. Today you can start building HTML5 applications on top of IE9, leveraging the hardware acceleration and the integration with Windows 7. With Mango, (the same!) IE9 will be available to Windows Phone 7 devices. On Windows 8, you will be able to build Windows applications using HTML5 and JavaScript. Come to the Build conference (www.buildwindows.com) in September to learn more about the new exciting Windows8 platform.
  9. Add Implement Get() for all and Get() for single Show Content Negotiation Show Odata Support Show using Post() Content-Type: application/json { "Name":"blah4", "UnitPrice":45.56 } // POST /api/products public HttpResponseMessage<Product> Post(Product product) { db.Products.Add(product); db.SaveChanges(); var result = new HttpResponseMessage<Product>(product, HttpStatusCode.Created); result.Headers.Location = new Uri(Request.RequestUri, "/api/products/" + product.ID.ToString()); return result; }
  10. Add Implement Get() for all and Get() for single Show Content Negotiation Show Odata Support Show using Post() Content-Type: application/json { "Name":"blah4", "UnitPrice":45.56 } // POST /api/products public HttpResponseMessage<Product> Post(Product product) { db.Products.Add(product); db.SaveChanges(); var result = new HttpResponseMessage<Product>(product, HttpStatusCode.Created); result.Headers.Location = new Uri(Request.RequestUri, "/api/products/" + product.ID.ToString()); return result; }
  11. Add Implement Get() for all and Get() for single Show Content Negotiation Show Odata Support Show using Post() Content-Type: application/json { "Name":"blah4", "UnitPrice":45.56 } // POST /api/products public HttpResponseMessage<Product> Post(Product product) { db.Products.Add(product); db.SaveChanges(); var result = new HttpResponseMessage<Product>(product, HttpStatusCode.Created); result.Headers.Location = new Uri(Request.RequestUri, "/api/products/" + product.ID.ToString()); return result; }