2. Create the Database Context
3. Edit connection string
4.
Install-Package EntityFramework
Enable-Migrations
add-migration
update-database
var tables = new List
{
new Table { Id = 1, Name = "Carson", seat = 4, },
new Table { Id = 2, Name = "Meredith", seat = 4 },
new Table { Id = 3, Name = "Arturo", seat = 2 },
new Table { Id = 4, Name = "Gytis", seat = 2 }
};
tables.ForEach(s => context.Tables.AddOrUpdate(p => p.Name, s));
context.SaveChanges();
Không có nhận xét nào:
Đăng nhận xét