Entries:
Comments:
Posts:

Loading User Information from Channel 9

Something went wrong getting user information from Channel 9

Latest Achievement:

Loading User Information from MSDN

Something went wrong getting user information from MSDN

Visual Studio Achievements

Latest Achievement:

Loading Visual Studio Achievements

Something went wrong getting the Visual Studio Achievements

ADO.NET Entity Framework 4.3 for Real Web Applications

Download

Right click “Save as…”

Slides (view online)
There are many demos on the Internet for using the Entity Framework but few seem to address good architectural project structures to use the Entity Framework in a layered application. This talk shows a well structured Visual Studio solution to use the Entity Framework in a new ASP.NET Web Forms and MVC application. In addition this talk covers Code-First and DB/Model First scenarios, POCO entities, the Repository Pattern, Object Contexts/DbContext, querying, and MVC vs. Web Forms implementation differences and the new Code Migrations feature of 4.3.
For more information, check out this course on Microsoft Virtual Academy:

Follow the Discussion

  • Adam,

    So, when you use fluent API validations, you are using EF validations, then you are bringing some domain concern to your data acces layer, don't you agree?

  • Adam TuliperAdam Tuliper

    Your validation can be kept in separate classes, so not entirely. Validation is often tied to your domain AND your data. Are you going to only have business validation that isn't duplicated in any way in your database? Not likely otherwise you aren't giving nice messages to your users. By the nature of development with db, you have validation rules in your db and your objects that at times duplicate so your domain concerns are really data concerns here that normally make it into the domain as it is.

    If you choose to go with another technology swap out your validation layer. You need some way to tie your validation to the user and/or db as it is, so changing a technology is going to result in some validation related refactoring anyways.

    In the case of EF, you are saying: 'ok, Im getting advantages of having integrated stack for MVC/Web Forms validation coupled with code first if I want it' all while having your validation in separate classes than you pocos, so its easily swapped as well if you choose a different validation mechanism.

Remove this comment

Remove this thread

close

Comments Closed

Comments have been closed since this content was published more than 30 days ago, but if you'd like to continue the conversation, please create a new thread in our Forums,
or Contact Us and let us know.