... Cart(); cart.AddItem(new Product { ProductID = 1, Price = 5 }, 10); cart.AddItem(new Product { ProductID = 2, Price = 2.1M }, 3) ; cart.AddItem(new Product { ProductID = 3, Price = 1000 }, 1); Assert.AreEqual(1056 .3, ... CART 135 10078ch05.qxd 3/ 11/09 9:09 PM Page 135 { / / Arrange: 5 products in the repository IProductsRepository repository = MockProductsRepository( new Product { Name...
Ngày tải lên: 06/08/2014, 08:22
... ASP. NET MVC) , and tend to attract the same kind of developers. There are differ- ences, though: • MonoRail can run on ASP. NET 2.0, whereas ASP. NET MVC requires version 3. 5. • Unlike ASP. NET MVC, ... output CHAPTER 2 ■ YOUR FIRST ASP. NET MVC APPLICATION22 10078ch02.qxd 3/ 26/09 12:06 PM Page 22 PART 2 ■ ■ ■ ASP. NET MVC in Detail ■CHAPTER 7 Overview of ASP....
Ngày tải lên: 06/08/2014, 08:22
Pro ASP.NET MVC Framework phần 2 pdf
... and complicated, MVC architecture splits that UI component in two (see Figure 3- 3). Figure 3- 3. MVC architecture for the Web In this architecture, requests are routed to a controller class, which processes ... later). 10078ch 03. qxd 2/17/09 4:11 PM Page 39 10078ch02.qxd 3/ 26/09 12:06 PM Page 36 Building Loosely Coupled Components O ne common metaphor in software architecture i...
Ngày tải lên: 06/08/2014, 08:22
Pro ASP.NET MVC Framework phần 4 docx
... RedirectToRouteResult Delete(int productId) { Product product = (from p in productsRepository.Products where p.ProductID == productId select p).First(); productsRepository.DeleteProduct(product); TempData["message"] ... for want of a SaveProduct() method). Update IProductsRepository: public interface IProductsRepository { IQueryable<Product> Products { get; } void SaveProduct...
Ngày tải lên: 06/08/2014, 08:22
Pro ASP.NET MVC Framework phần 5 pot
... CHAPTER 7 ■ OVERVIEW OF ASP. NET MVC PROJECTS 219 10078ch07.qxd 3/ 26/09 12:24 PM Page 219 Figure 7-8. The ASP .NET MVC r equest processing pipeline Stage 1: IIS I nter net Infor mation Ser vices ... actual MVC Framework. MvcRouteHandler knows how to take the r equest context data and invoke the corresponding controller class. CHAPTER 7 ■ OVERVIEW OF ASP. NET MVC PROJE...
Ngày tải lên: 06/08/2014, 08:22
Pro ASP.NET MVC Framework phần 6 pps
... Internally, it holds a cache of all the types in all your ASP. NET MVC project’s referenced assemblies (not just in your ASP. NET MVC project itself!) that qualify to be controller classes, according ... aren’t authorized. Fortunately, the ASP. NET MVC team has anticipated this problem, and has added special logic to AuthorizeAttribute to make it play well with ASP. NET ou...
Ngày tải lên: 06/08/2014, 08:22
Pro ASP.NET MVC Framework phần 7 pot
... VIEWS 35 3 10078ch10.qxd 3/ 16/09 1:05 PM Page 35 3 Understanding How ASPX Templates Are Compiled Each time you create a new view page, Visual Studio gives you an ASPX template (e.g., MyView.aspx ... typed) to be inspected for properties and values. The framework s outbound URL-generation facility will CHAPTER 10 ■ VIEWS 33 5 10078ch10.qxd 3/ 16/09 1:01 PM Page 33 5 ■Tip When you suppl...
Ngày tải lên: 06/08/2014, 08:22
Pro ASP.NET MVC Framework phần 8 docx
... further effort (as shown in Figure 11-5). CHAPTER 11 ■ DATA ENTRY394 10078ch11.qxd 3/ 26/09 12: 13 PM Page 39 4 ASP. NET MVC takes a similar approach to let your action methods receive uploaded files. A ll ... (http://xval. codeplex.com/ ). It’s a free, open source project that I’ve started after much discussion with other developers who use ASP. NET MVC. xVal adds client-side val...
Ngày tải lên: 06/08/2014, 08:22
Pro ASP.NET MVC Framework phần 9 pdf
... in an ASP. NET MVC application. ■Note This isn’t intended to be a complete reference to jQuery, because it’s separate from ASP. NET MVC. I will simply demonstrate jQuery working with ASP. NET MVC ... them clearly. The good news for ASP. NET MVC developers is that ASP. NET MVC isn’t likely to introduce significant new risks. It takes an easily understood bare-bones app...
Ngày tải lên: 06/08/2014, 08:22
Pro ASP.NET MVC Framework phần 10 ppsx
... 527 10078ch15.qxd 3/ 23/ 09 9:02 PM Page 527 ASP. NET Platform Features ASP. NET MVC is not designed to stand alone. As a web development framework, it inherits much of its power from the underlying ASP. NET platform, ... database. Cr eating a Custom Profile Pro vider As is usual for ASP. NET s provider model, you can create a custom profile provider by deriving a class from...
Ngày tải lên: 06/08/2014, 08:22