Generate a composite unique constraint/index with owned entity, in EF Core

前端 未结 1 1257
时光说笑
时光说笑 2021-01-22 19:27

I have an entity that owns another entity

public class Entity1
{
  [Key]
  [DatabaseGenerated(DatabaseGeneratedOption.Identity)]
  public virtual int ID { get; s         


        
相关标签:
1条回答
  • 2021-01-22 20:03

    Apparently EF Core doesn't support this feature yet.

    See this issue on GitHub: https://github.com/aspnet/EntityFrameworkCore/issues/11336

    There is also a workaround offered, which I have not tested myself.

    0 讨论(0)
提交回复
热议问题