entityframework

You can subscribe to the entityframework tag micro-feed.

Stale Data in Entity Framework

There is a subtle bug that you can encounter when using Entity Framework on a database where updates can happen out of band. For example, the situation I discovered this issue involves a replicated SQL database, with Entity Framework running in “read only” mode against the replication subscriber databases. The data is changed in the […]

Mocking Entity Framework DbContext and IDbSet With Rhino Mocks

This is something that can take a little figuring out – using Rhino Mocks to mock a DbContext and the associated IDBSets. Because of this, I created a little generic method that helps a lot… private static IDbSet<T> GetDbSetTestDouble<T>(IList<T> data) where T : class { IQueryable<T> queryable = data.AsQueryable(); IDbSet<T> dbSet = MockRepository.GenerateMock<IDbSet<T>, IQueryable>(); dbSet.Stub(m […]