为 Entity Framework 导航 属性 创建默认对象
Creating a default object for Entity Framework navigation property
我有一个 class 客户端,如下所示
public class Client
{
public int UniqueLoginsPerDay { get; set; }
public virtual Limit Limit { get; set; }
public int LimitId { get; set; }
}
然后我有一个限制class
public class Limit
{
public string Email{ get; set; } = myMail@gmail.com;
public int UniqueLoginsPerDayLimit { get; set; } = 200000;
public virtual Client Client{ get; set; }
public int ClientId { get; set; }
}
将 "default" 限制对象附加到我的客户端实体的最明智方法是什么?
我正在使用 EntityFramework.Core 7.0.0-rc1-final
我知道这个question,那里给出的解决方案不适用于EntityFramework.Core 7.0.0-rc1-final。
这对我来说听起来像是业务逻辑。你能把它移到比数据访问更高的地方吗类?
我有一个 class 客户端,如下所示
public class Client
{
public int UniqueLoginsPerDay { get; set; }
public virtual Limit Limit { get; set; }
public int LimitId { get; set; }
}
然后我有一个限制class
public class Limit
{
public string Email{ get; set; } = myMail@gmail.com;
public int UniqueLoginsPerDayLimit { get; set; } = 200000;
public virtual Client Client{ get; set; }
public int ClientId { get; set; }
}
将 "default" 限制对象附加到我的客户端实体的最明智方法是什么?
我正在使用 EntityFramework.Core 7.0.0-rc1-final
我知道这个question,那里给出的解决方案不适用于EntityFramework.Core 7.0.0-rc1-final。
这对我来说听起来像是业务逻辑。你能把它移到比数据访问更高的地方吗类?