0

实体:

public class Good : FullAuditedAggregateRoot<Guid>
{
   ///******///
  public virtual SaleStates SaleStates { get; set; }
}

模型构建器:

builder.Entity<Good>(b =>
{
  ///******///
  b.OwnsOne(f=>f.SaleStates).WithOwner();
}

错误:

System.InvalidOperationException : The type 'SaleStates' cannot be marked as owned because a non-owned entity type with the same name already exists.

https://docs.microsoft.com/en-us/ef/core/what-is-new/ef-core-3.0/break-changes#config

4

1 回答 1

0

这似乎是ABP中的一个问题。遇到这个问题时,唯一对我有帮助的是[Owned]在值对象的类名上方使用属性。

于 2020-07-19T12:56:47.300 回答