What I've done is to wrap (in my case Linq2Sql) in my own custom class, which implements the repository pattern, here's the pasted excerpt from a previous but somewhat related answer.
I'd recommend reading through The Onion Architecture and looking at the MVC StoreFront videos for inspiration. The magic part is, pushing the Linq2Sql part or EF stuff to one side, So you don't sit on top of it as much as, Pull it in if you want it, that way you could use Linq2Sql or EF or NHibernate. This is more work, but gives you more flexibility.
Here's my example CarProject
In Car.Core project
public interface ICarRepository
{
IQueryable<Car> GetAllCars();
void Add(Car);
}
I then have a implementation of the interface which wraps up access to the generated Linq2Sql class.
Car.Data project
public class SqlCarRepository : ICarRepository
{
private CarDataContext _context;
public SqlCarRepository()
{
_context = new CarDataContext();
}
#region ICarRepository Members
public IQueryable<Car> GetAllCars()
{
return _context.Cars;
}
You could have a EF equivilent ofcourse, or NHibernate.
I haven't got all this completely sorted, and I'm still learning but I currently have these projects:
Car.Core --- All the interfaces and domain objects, DTO's etc
Car.Core.Tests --- The tests of the core business logic.
Car.Web --- Asp.net MVC frontend
Car.Web.Tests --- Tests for the website
Car.Data --- The Linq2Sql stuff lives in here
Car.Data.Tests --- The tests for the DAL layer
In your scenario you could either put EF in Car.Data or maybe change it to Car.Linq2Sql and Car.EntityFramework. Not sure what I'd do.