In Entity Framework 4.1, when creating POCO, if the class needs to be encoded to initialize Many relationships, or is there some reason that allows the Entity Framework to have control over these properties?
public class Portfolio { private ICollection<Visit> _visits; public virtual ICollection<Visit> Visits { get { if (_visits == null) { _visits = new List<Visit>(); } return _visits; } set { _visits = value; } } }
or
public class Portfolio { public virtual ICollection<Visit> Visits { get; set; } }
Is there an even better template?
Swaff
source share