In my model I have these entities:
public interface IOrder
{
string Name {get;set;}
List<IProduct> OrderedProducts {get;set;}
}
public interface IProduct {}
In partial class generated by linq-to-sql I map these properties on my entity properties:
public partial class Order : IOrder
{
List<IProduct> OrderedProducts
{
get { return this.L2SQLProducts.Cast<IProduct>.ToList(); }
set { this.L2SQLProducts = ??? }
}
}
How should setter look like?
EDIT: Purpose of this is to have interface that I could MOCK for unit testing or change linq-to-sql to another DAL.