Relative Content

Tag Archive for entity-framework

Is There a Real Advantage to Generic Repository?

Was reading through some articles on the advantages of creating Generic Repositories for a new app (example). The idea seems nice because it lets me use the same repository to do several things for several different entity types at once:

Entity Framework with large systems – how to divide models?

I’m working with a SQL Server database with 1000+ tables, another few hundred views, and several thousand stored procedures. We are looking to start using Entity Framework for our newer projects, and we are working on our strategy for doing so. The thing I’m hung up on is how best to split the tables into different models (EDMX or DbContext if we go code first). I can think of a few strategies right off the bat:

Where to put custom validation while using Entity Framework

I am using MVC3 and Enitty Framework 4 with the Database first approach. It created the context template with its own validation for the fields based on the database. My question is where should I put the other validation based on the buisness logic. Should I put it in the Context.tt file, should it go in the controller or should it go in a seperate model?