Spring.NET and ADO.NET Entity Data Model

Posted by Jason on Stack Overflow See other posts from Stack Overflow or by Jason
Published on 2010-05-12T13:50:46Z Indexed on 2010/05/12 13:54 UTC
Read the original article Hit count: 386

Having defined an ADO.NET Entity Data Model, I can then instantiate it in a Repository class to query against the database.

using (ApplicationEntities ctx = new ApplicationEntities())
{
   // query, CRUD, etc
}

However, that particular line of code becomes boilerplate in most of the methods in the repository class.

Is it possible to just use Spring.NET to inject the Entity Data Model, either in the class or, even better, in an abstract parent class that all the repositories inherit from?

© Stack Overflow or respective owner

Related posts about spring.net

Related posts about ado.net-entity-data-model