Hi Molinari;
Please see code example below.
[TestMethod]
public void UsingDefaultManager() {
var mgr1 = new NorthwindIBEntityManager();
var mgr2 = new FantasyFootballEntityManager();
var a = mgr1.Employees.FirstOrNullEntity();
var b = mgr2.Clubs.Take(9).ToList();
var default1 = NorthwindIBEntityManager.DefaultManager;
EntityManager.DefaultManager = mgr2;
var default2 = FantasyFootballEntityManager.DefaultManager;
var clubInCache = default2.FindEntities<Club>(EntityState.AllButDetached).ToList();
}
The last query finds all entities of type Club in cache. The results are 9 clubs which is correct because the previous query
mgr2.Clubs.Take(9).ToList();
takes 9 Club entities and put them in cache.