I want to write a rich domain class such as
public class Product
{
public IEnumerable Photos {get; private set;}
public void A
You can overcome this by using the ReadOnlyCollection(Of T)
public class Product
{
private IList _photos;
public IList Photos {
get
{
return _photos.AsReadOnly();
}
private set { _photos = value; }
}
public void AddPhoto(){...}
public void RemovePhoto(){...}
}
EDIT:
ICollection
=> IList
Hope that is what you were looking for.