public class ProductDto
{
public int Id { get; set; }
public string Name { get; set; }
public virtual List<PriceDto> Prices { get; set; }
}
public class ProductVm:ProductDto
{
public new List<PriceVm> Prices { get; set; }
}
public abstract class ProductDtoBase<T> where T : PriceDto
{
public int Id { get; set; }
public string Name { get; set; }
public virtual List<T> Prices { get; set; }
}
public class ProductDto : ProductDtoBase<PriceDto>
{
}
public class ProductVm : ProductDtoBase<PriceVm>
{
}