ASP.NET 4.0 in Practice by Daniele Bochicchio Stefano Mostarda Marco De Sanctis

ASP.NET 4.0 in Practice by Daniele Bochicchio Stefano Mostarda Marco De Sanctis

Author:Daniele Bochicchio, Stefano Mostarda, Marco De Sanctis
Language: eng
Format: epub, pdf
Publisher: Manning Publications


Now that you have an overall picture of how CategoriesModelBinder works, we can take a closer look at how we manage to retrieve the categories from the request in GetPostedCategories, whose code is shown in the following listing.

Listing 9.15. Retrieving Categories from the Request

This code doesn’t contain much that’s strictly ASP.NET MVC; this framework comes up just to read the string of IDs from the request . In fact, once we have the string, it’s just a matter of translating it into actual Category instances . GetCategoriesFrom-String accomplishes this task, splitting the sequence of IDs and, in turn, retrieving them using the current active Entity Framework context .



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.