EntityFramework.LazyLoading
EntityFramework.LazyLoading copied to clipboard
Use dynamic proxy objects instead of LazyReference<T>
In the current version, for each Reference you need to define in your model a field of type LazyReference<T>.
Ex:
public class Course
{
...
private LazyReference<Department> _departmentLazy = new LazyReference<Department>();
public Department Department
{
get
{
return _departmentLazy.GetValue(this, nameof(Department));
}
set
{
_departmentLazy.SetValue(value);
}
}
...
}
Using dynamic Proxy objects would be better, because you don't have to define in your model such fields.