EF 5 Enable-Migrations : No context type was found in the assembly

后端 未结 24 2091
野的像风
野的像风 2020-12-02 11:51

I have 4 projects :

Toombu.Entities : all models are there
Toombu.DataAccess: Mapping, Repository and ToombuContext
Toombu.Logique : Logic of my application         


        
24条回答
  •  时光说笑
    2020-12-02 12:41

    This error getting because of the compiler not getting 'Context' class in your application. So, you can add it manually by Add --> Class and inherit it with 'DbContext' Class For Example :

    public class MyDbContext : DbContext
        {
            public DbSet Customer { get; set; }
            public MyDbContext()
            {
            }
        }
    

提交回复
热议问题