Resolving 'No key Defined' errors while using OnModelCreating with ApplicationDbContext?

后端 未结 3 754
我寻月下人不归
我寻月下人不归 2021-01-12 11:40

I\'ve been trying to create navigation properties for my collection types and I found this example of how one person accomplished it using OnModelCreating. I gave it a try i

3条回答
  •  时光说笑
    2021-01-12 12:21

    I think the issue is that you have removed the calling of base class from OnModelCreating. Try adding that also as shown below

    protected override void OnModelCreating(DbModelBuilder modelBuilder)
        {
            base.OnModelCreating(modelBuilder);
    
            //Your configuration goes here
        }
    

提交回复
热议问题