novidades do asp.net mvc3 preview 1
DESCRIPTION
Palestra realizada no evento The Developers Conference em São Paulo no dia 21/08/2010.TRANSCRIPT
![Page 1: Novidades do ASP.NET MVC3 Preview 1](https://reader035.vdocuments.pub/reader035/viewer/2022062418/5560b840d8b42af43b8b4bc4/html5/thumbnails/1.jpg)
Globalcode – Open4education
As novidades do ASP.NET MVC 3Victor Cavalcante
Arquiteto de Software/Agile Coach – Stefanini
@vcavalcante
![Page 2: Novidades do ASP.NET MVC3 Preview 1](https://reader035.vdocuments.pub/reader035/viewer/2022062418/5560b840d8b42af43b8b4bc4/html5/thumbnails/2.jpg)
Globalcode – Open4education
Agenda
Novidades do ASP.NET MVC 3
![Page 3: Novidades do ASP.NET MVC3 Preview 1](https://reader035.vdocuments.pub/reader035/viewer/2022062418/5560b840d8b42af43b8b4bc4/html5/thumbnails/3.jpg)
Globalcode – Open4education
O que preciso saber?
27/07/2010 lançado o Preview 1 do ASP.NET MVC 3
Download em: http://tinyurl.com/aspnetmvc3p1
Compatível com ASP.NET MVC 2
Funciona lado a lado com ASP.NET MVC 2
Somente acrescenta funcionalidades
![Page 4: Novidades do ASP.NET MVC3 Preview 1](https://reader035.vdocuments.pub/reader035/viewer/2022062418/5560b840d8b42af43b8b4bc4/html5/thumbnails/4.jpg)
Globalcode – Open4education
Novidades
Nova caixa de diálogo para adicionar View
![Page 5: Novidades do ASP.NET MVC3 Preview 1](https://reader035.vdocuments.pub/reader035/viewer/2022062418/5560b840d8b42af43b8b4bc4/html5/thumbnails/5.jpg)
Globalcode – Open4education
Novidades - Razor
Nova View Engine
Compacta e Expressiva
Fácil de aprender
Não é uma linguagem
Funciona em qualquer editor
Habilita Test Unitário na View
Por enquanto só C#
Intellissense?
Colorização do código?
![Page 6: Novidades do ASP.NET MVC3 Preview 1](https://reader035.vdocuments.pub/reader035/viewer/2022062418/5560b840d8b42af43b8b4bc4/html5/thumbnails/6.jpg)
Globalcode – Open4education
Demo - Razor
![Page 7: Novidades do ASP.NET MVC3 Preview 1](https://reader035.vdocuments.pub/reader035/viewer/2022062418/5560b840d8b42af43b8b4bc4/html5/thumbnails/7.jpg)
Globalcode – Open4education
Futuro – Preview 2?
![Page 8: Novidades do ASP.NET MVC3 Preview 1](https://reader035.vdocuments.pub/reader035/viewer/2022062418/5560b840d8b42af43b8b4bc4/html5/thumbnails/8.jpg)
Globalcode – Open4education
Filtros Globais
Possibilidade de aplicar um filtro globalmente
Para todos os Controllers da sua aplicação
Definido no Global.asax
![Page 9: Novidades do ASP.NET MVC3 Preview 1](https://reader035.vdocuments.pub/reader035/viewer/2022062418/5560b840d8b42af43b8b4bc4/html5/thumbnails/9.jpg)
Globalcode – Open4education
Demo
![Page 10: Novidades do ASP.NET MVC3 Preview 1](https://reader035.vdocuments.pub/reader035/viewer/2022062418/5560b840d8b42af43b8b4bc4/html5/thumbnails/10.jpg)
Globalcode – Open4education
Novo Dynamic ViewModel
ViewModel é uma propriedade do Controller que é do tipo Dynamic
Internamente o dado continua na ViewData
![Page 11: Novidades do ASP.NET MVC3 Preview 1](https://reader035.vdocuments.pub/reader035/viewer/2022062418/5560b840d8b42af43b8b4bc4/html5/thumbnails/11.jpg)
Globalcode – Open4education
Demo
![Page 12: Novidades do ASP.NET MVC3 Preview 1](https://reader035.vdocuments.pub/reader035/viewer/2022062418/5560b840d8b42af43b8b4bc4/html5/thumbnails/12.jpg)
Globalcode – Open4education
ActionResult Types
Possibilidade de retornar o código http correto de forma fácil.
Action Result Types
HttpNotFoundResult404
HttpRedirectResult302
RedirectPermanent301
RedirectToRoutePermanent301
RedirectToActionPermanent301
HttpStatusCodeResult
customizado
![Page 13: Novidades do ASP.NET MVC3 Preview 1](https://reader035.vdocuments.pub/reader035/viewer/2022062418/5560b840d8b42af43b8b4bc4/html5/thumbnails/13.jpg)
Globalcode – Open4education
ActionResult Helpers
![Page 14: Novidades do ASP.NET MVC3 Preview 1](https://reader035.vdocuments.pub/reader035/viewer/2022062418/5560b840d8b42af43b8b4bc4/html5/thumbnails/14.jpg)
Globalcode – Open4education
JavaScript
Possibilidade de receber como input um JSON
DataBind diretamente de um JSON
Previsto melhor suporte a unobstrusive JavaScript
Inclusão do jquery.validate.js no projeto (não integrado ainda)
![Page 15: Novidades do ASP.NET MVC3 Preview 1](https://reader035.vdocuments.pub/reader035/viewer/2022062418/5560b840d8b42af43b8b4bc4/html5/thumbnails/15.jpg)
Globalcode – Open4education
Demo
![Page 16: Novidades do ASP.NET MVC3 Preview 1](https://reader035.vdocuments.pub/reader035/viewer/2022062418/5560b840d8b42af43b8b4bc4/html5/thumbnails/16.jpg)
Globalcode – Open4education
Injeção de Dependência
Estrutura do MVC:
ControllerBuilder
ControllerFactory
Controller
ViewEngine
View
ControllerActionInvoker
ActionResult
ActionFilters
Model Binders
![Page 17: Novidades do ASP.NET MVC3 Preview 1](https://reader035.vdocuments.pub/reader035/viewer/2022062418/5560b840d8b42af43b8b4bc4/html5/thumbnails/17.jpg)
Globalcode – Open4education
Injeção de Dependência
AgoraControllers (registering & injecting controller factories, injecting controllers)
Views (registering & injecting view engines, injecting dependencies into view pages)
Action Filters (locating & injecting filters)
FuturoModel Binders (registering & injecting)
Value Providers (registering & injecting)
Validation Providers (registering & injecting)
Model metadata Providers (registering & injecting)
![Page 18: Novidades do ASP.NET MVC3 Preview 1](https://reader035.vdocuments.pub/reader035/viewer/2022062418/5560b840d8b42af43b8b4bc4/html5/thumbnails/18.jpg)
Globalcode – Open4education
Common Service Locator
Interface Comum para todos os containers
http://commonservicelocator.codeplex.com/
Será incluído no ASP.NET MVC 3
![Page 19: Novidades do ASP.NET MVC3 Preview 1](https://reader035.vdocuments.pub/reader035/viewer/2022062418/5560b840d8b42af43b8b4bc4/html5/thumbnails/19.jpg)
Globalcode – Open4education
Links
http://weblogs.asp.net/scottguportuguese/archive/2010/07/27/apresentando-a-asp-net-mvc-3-amostra-1.aspx
http://aspnet.codeplex.com/releases/view/50092#DownloadId=140348
http://weblogs.asp.net/scottgu/archive/2010/07/02/introducing-razor.aspx
http://weblogs.asp.net/jacqueseloff/archive/2010/07/30/mvc-3-supporting-custom-view-engines.aspx
![Page 20: Novidades do ASP.NET MVC3 Preview 1](https://reader035.vdocuments.pub/reader035/viewer/2022062418/5560b840d8b42af43b8b4bc4/html5/thumbnails/20.jpg)
Globalcode – Open4education
Links
http://www.viddler.com/explore/mvcconf/videos/4/
http://blog.devlpr.net/2010/07/27/asp-net-mvc-3-new-features-in-preview-1/
http://www.michaelhamrah.com/blog/2010/08/the-new-webapp-architecture-asp-net-mvc-3-jquery-templating-with-pure-and-the-json-value-provider/
http://bradwilson.typepad.com/blog/2010/07/service-location-pt1-introduction.html
![Page 21: Novidades do ASP.NET MVC3 Preview 1](https://reader035.vdocuments.pub/reader035/viewer/2022062418/5560b840d8b42af43b8b4bc4/html5/thumbnails/21.jpg)
Globalcode – Open4education
Dúvidas?
![Page 22: Novidades do ASP.NET MVC3 Preview 1](https://reader035.vdocuments.pub/reader035/viewer/2022062418/5560b840d8b42af43b8b4bc4/html5/thumbnails/22.jpg)
Globalcode – Open4education22