Migration not working as I wish… Asp.net EntityFramework

后端 未结 4 1034
攒了一身酷
攒了一身酷 2020-12-12 06:58

I was studying this tutorial asp.net Movie Tutorial and I have 2 simple files in my model.

 public class Movie
{
    public int ID { get; set; }

    [Requ         


        
4条回答
  •  清歌不尽
    2020-12-12 07:44

    you can use enable Migration like this :

    Enable Migration -ContextTypeName UsersContext
    

    or you can define public DbSet User { get; set; } in your MovieDBContext like this :

    public class MovieDBContext : DbContext
    {
        public DbSet Movies { get; set; }
        public DbSet User{get;set} 
    
    }
    

    and use this way :

    Enable Migration -ContextTypeName MovieDBContext
    

提交回复
热议问题