capitulo 09-10
TRANSCRIPT
![Page 1: Capitulo 09-10](https://reader035.vdocument.in/reader035/viewer/2022081514/5584b107d8b42a8f768b4619/html5/thumbnails/1.jpg)
ASP.net MVC 4 con C#Jesus AnguloMCTS & MSP Facebook.com/jesuslink2514Twitter.com/jesulink2514
![Page 2: Capitulo 09-10](https://reader035.vdocument.in/reader035/viewer/2022081514/5584b107d8b42a8f768b4619/html5/thumbnails/2.jpg)
Agenda9. Controlando Urls con Routing9.1 Url schema9.2 Debugging routes9.3 Testing routes
10. Model Binders y Value Providers10.1 El pipeline de ejecución en MVC10.2 Creando un model binder personalizado10.3 Creando un value provider personalizado
![Page 3: Capitulo 09-10](https://reader035.vdocument.in/reader035/viewer/2022081514/5584b107d8b42a8f768b4619/html5/thumbnails/3.jpg)
RountingAjax
![Page 4: Capitulo 09-10](https://reader035.vdocument.in/reader035/viewer/2022081514/5584b107d8b42a8f768b4619/html5/thumbnails/4.jpg)
Routing• Todo lo que
tienen que ver con la manera en la que las peticiones web se mapean a controladores y como el framework mvc construye rutas para links y peticiones Ajax
![Page 5: Capitulo 09-10](https://reader035.vdocument.in/reader035/viewer/2022081514/5584b107d8b42a8f768b4619/html5/thumbnails/5.jpg)
La Ruta por defecto
{controller}/{action}/{id}
Controller=Home,Action = Index,
Id= UrlPatameter.Optional
![Page 6: Capitulo 09-10](https://reader035.vdocument.in/reader035/viewer/2022081514/5584b107d8b42a8f768b4619/html5/thumbnails/6.jpg)
Routing~/books/details/4
public class BooksController:Controller{
public ActionResult Details(int id){
….}
}
![Page 7: Capitulo 09-10](https://reader035.vdocument.in/reader035/viewer/2022081514/5584b107d8b42a8f768b4619/html5/thumbnails/7.jpg)
Consejos para Diseñar un Esquema de Rutas Hacer rutas simples y limpias Hacer url hackeables Difereciar peticiones usando parametros de Url
Evitar exponer ID’s de base de datos innecesariamente
Considerar agregar informacion innecesaria
![Page 8: Capitulo 09-10](https://reader035.vdocument.in/reader035/viewer/2022081514/5584b107d8b42a8f768b4619/html5/thumbnails/8.jpg)
DEMO
Esquemas de Rutas
Construcción y depuración de Rutas
![Page 9: Capitulo 09-10](https://reader035.vdocument.in/reader035/viewer/2022081514/5584b107d8b42a8f768b4619/html5/thumbnails/9.jpg)
Model Binders y Value Providers
Asp.net MVC
![Page 10: Capitulo 09-10](https://reader035.vdocument.in/reader035/viewer/2022081514/5584b107d8b42a8f768b4619/html5/thumbnails/10.jpg)
MVC Pipeline
![Page 11: Capitulo 09-10](https://reader035.vdocument.in/reader035/viewer/2022081514/5584b107d8b42a8f768b4619/html5/thumbnails/11.jpg)
MVC Pipeline
![Page 12: Capitulo 09-10](https://reader035.vdocument.in/reader035/viewer/2022081514/5584b107d8b42a8f768b4619/html5/thumbnails/12.jpg)
Model Binder• Es el mecanismo por el
cual MVC transforma los datos provenientes de los formularios, cookies , variables de Session ,querystring ,etc en objetos con los que podamos trabajar mas cómodamente.
![Page 13: Capitulo 09-10](https://reader035.vdocument.in/reader035/viewer/2022081514/5584b107d8b42a8f768b4619/html5/thumbnails/13.jpg)
DEMO
Model Binders
Custom Model Binder con Entity Framework
![Page 14: Capitulo 09-10](https://reader035.vdocument.in/reader035/viewer/2022081514/5584b107d8b42a8f768b4619/html5/thumbnails/14.jpg)
© 2013 Microsoft Corporation. All rights reserved. Microsoft, Windows, and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries.The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.
Gracias ! Hasta el próximo capítulo
/jesulink2514
/jesulink2514Domingo 19 de Enero
AutoMapper y Controladores Ligeros