我有类似的东西:
public class Discount {
public int Id {get;set;}
public Durration<int> Durration {get;set;}
}
public class Durration<T> {
public T From {get;set;}
public T To {get;set;}
}
在DbContext中
///
public DbSet<Discount> Discounts {get;set;}
///
当我通过EF将其映射到数据库时,不会出现“Durration”类/属性。无论是表还是复杂类型。可以做些什么?