Hi tersiusk;
After further investigation, it looks like this is a bug although not quite a high priority one. The reason being is that the Login method is not really the place to modify your entities (querying is fine) so we're thinking of blocking the SaveChanges call within the LoginManager.
One does not need to go to the server side to populate the fake EM. For example, it can be done the following way on the client.
var em = new DomainModelEntityManager(compositionContextName:
CompositionContext.Fake.Name);
PopulateBackingStore(em);
em.Clear(); // clear cache; no memory of prior entities
var q = em.Customers.Include(c => c.OrderSummaries)
.Where(c => c.OrderSummaries.Any(
os => os.Employee.FirstName == "Fred"));
private void PopulateFakeBackingStore(EntityManager em) {
var customer = new Customer("TestCompany");
em.AddEntity(customer);
var employee = new Employee("Fred", "Smith");
em.AddEntity(employee);
for (int i = 0; i < 5; i++) {
var salesOrder = new OrderSummary(customer, employee);
em.AddEntity(salesOrder);
}
em.SaveChanges();
}
I hope this helps.