19 lines
707 B
C#
19 lines
707 B
C#
using BHServer.Models;
|
|
using Microsoft.EntityFrameworkCore;
|
|
|
|
namespace BHServer.Data
|
|
{
|
|
public class ApplicationDbContext : DbContext
|
|
{
|
|
public ApplicationDbContext(DbContextOptions<ApplicationDbContext> options) : base(options)
|
|
// this will pass along the options from the implementation to the definition
|
|
{
|
|
}
|
|
|
|
public DbSet<Province> Provinces { get; set; } // specify the table and it's class
|
|
// to run migrations, run `add-migration <name of the migration>` in the NuGet console
|
|
// then make the migrations from the console by using `update-database`
|
|
// to rollback migrations run the command `remove-migration <name>`
|
|
}
|
|
}
|