www.deeptraining.com www.deeptraining.com/litwin Model. View. Controller. •Create ASP.NET MVC Application •Go ahead and let VS create test app •Remove following starter files •Controllers|HomeController.cs •All views in Views|Home.
Download ReportTranscript www.deeptraining.com www.deeptraining.com/litwin Model. View. Controller. •Create ASP.NET MVC Application •Go ahead and let VS create test app •Remove following starter files •Controllers|HomeController.cs •All views in Views|Home.
www.deeptraining.com www.deeptraining.com/litwin Model. View. Controller. •Create ASP.NET MVC Application •Go ahead and let VS create test app •Remove following starter files •Controllers|HomeController.cs •All views in Views|Home folder •In Test app, Controllers|HomeControllerTest.cs •We will use LINQ to SQL •We will build a model on 3 tables from Northwind •Products •Change ProductID to id •Categories •Suppliers •Set UpdateCheck property on Product fields to Never •While we could have controller call LINQ to SQL classes, directly, it’s better to provide another layer using a repository pattern •We will create repository classes for each model object •Very similar to creating a business tier in N-tier app design Add View Use strong-typed view ProductsApp.Models.Product if (!ModelState.IsValid) ProductRepository Refactor|Extract Interface Controllers Unit Test HomeControllerTest Run Tests Add New Test http://asp.net/mvc http://www.asp.net/ http://silverlight/ http://www.microsoft.com/expression/ http://www.microsoft.com/windows/internet-explorer/default.aspx http://tinyurl.com/top10nola www.microsoft.com/teched www.microsoft.com/learning http://microsoft.com/technet http://microsoft.com/msdn Sign up for Tech·Ed 2011 and save $500 starting June 8 – June 31st http://northamerica.msteched.com/registration You can also register at the North America 2011 kiosk located at registration Join us in Atlanta next year