I'm using Entity Framework 5 with lazy loading enabled. I have got the following code:
private ICollection<Subscription> _subscriptions = new Collection<Subscription>();
public virtual ICollection<Subscription> Subscriptions
{
get { return _subscriptions; }
set { _subscriptions = value; }
}
But does this make sense? I want to ensure that the public property Subscriptions
is never null. Due to the virtual entity framework overrides the getter and setter to provide the lazy loading functionality.
Do I need this field or can I just use an auto property and I get an empty list if there is no Subscription?