This repository has been archived on 2025-04-28. You can view files and clone it, but cannot push or open issues/pull-requests.
DotNetServer/Data/ApplicationDbContext.cs

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>`
}
}