Thêm bảng trong entity framework code first (Entity Framework Automatic Code First Migrations)

  1. Kiểm tra project của bạn đã cài đặt entity framework chưa
  2. Vào tool Nuget Packet Manager trên Visual Studio
    Tools –> Library Package Manager –> Package Manager Console
  3. Enable auto Migrations
    Enable-Migrations –EnableAutomaticMigrations
    Enable-Migrations –EnableAutomaticMigrations -Force

  4. Update database
    Update-Database –Verbose

Leave a Reply