Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Design Pattern to use with Entity Framework Code First

I am working on creating a Technical Design Document for my new project that is being developed using Entity Framework 4.1 Code First.

I want my DAL to be to be loosely coupled, easily testable and should be able to dynamically inject it using IoC Container...

Thinking of using Repository Pattern. Are there any good resources for reference?

--

Preetham Reddy

like image 530
Preetham Reddy Avatar asked Jun 21 '11 22:06

Preetham Reddy


People also ask

Which design pattern is used for Entity Framework?

In this example we will first implement a sample application using pure MVC architecture and then we will see how to improve our code standards by implementing the repository design pattern.

Which data model should be used for code first approach?

Code First allows you to define your model using C# or VB.Net classes. Additional configuration can optionally be performed using attributes on your classes and properties or by using a fluent API.

Which is better code first or database first in Entity Framework?

Versioning databases is hard, but with code first and code first migrations, it's much more effective. Because your database schema is fully based on your code models, by version controlling your source code you're helping to version your database.


1 Answers

See these tutorials: http://www.asp.net/entity-framework/tutorials/implementing-the-repository-and-unit-of-work-patterns-in-an-asp-net-mvc-application http://www.asp.net/entity-framework/tutorials/using-the-entity-framework-and-the-objectdatasource-control-part-2-adding-a-business-logic-layer-and-unit-tests

like image 142
tdykstra Avatar answered Nov 15 '22 08:11

tdykstra