问题
I'm trying to develop a generic repository on Entity Framework 5 for get data from any table and I want to use disconnected context without lazy and eager loading. Is it possible? I'm using the code below, but it doesn't works:
T it's entity type.
public IList<T> GetData(Expression<Func<T, bool>> expression)
{
using (var context = new Context())
{
return context.Set<T>().Where(expression).ToList();
}
}
Just the main entity it's loaded, the relationships no.
来源:https://stackoverflow.com/questions/19393748/entity-framework-5-is-it-possible-to-load-relationships-associations-without