This project has moved. For the latest updates, please go here.

Lazy Loading not working?

Sep 28, 2015 at 2:57 PM
Has any one else had any success with lazy loading when using Effort for unit testing? We have code that relies heavily on lazy loading and it works just fine it runs as web application.

But we can't get a simple navigational property to be populated with Effort. This would cause a NullReferenceException:
...
var myEntity = new MyEntity
{
   Id = 1,
   Status = new Status { Id = 1, Name = "StatusName"} 
};

myManager.AddToDb(myEntity);
var myAttachedEntity = myManager.GetMyEntityById(1);
var statusName = myAttachedEntity.Status.StatusName; // <-- BOOM!
Forcing lazy loading programmatically doesn't help either:
Configuration.LazyLoadingEnabled = true;
Configuration.ProxyCreationEnabled = true;
So far, I'm loving Effort but this is a show stopper for us. Thankful for any kind of advice on this one!