Why does the entity framework need an ICollection for lazy loading?

I think i found the solution…See here for more details: http://social.msdn.microsoft.com/Forums/en-US/adodotnetentityframework/thread/47296641-0426-49c2-b048-bf890c6d6af2/ Essentially you want to make the ICollection type protected and use this as the backing collection for the public IEnumerable public class Product { // This is a mapped property protected virtual ICollection<Photo> _photos { get; set; } // This is an un-mapped property … Read more

IQueryable & Repositories – take 2?

DDD Repository should encapsulate data access technicalities: Definition: A Repository is a mechanism for encapsulating storage, retrieval, and search behavior which emulates a collection of objects. It is also responsible for handling middle and end of life of domain objects. Repository interface belongs to Domain and should be based on Ubiquitous Language as much as … Read more