ApplicationContext db sets
This commit is contained in:
parent
22cd2f984e
commit
dafcfab6a7
@ -1,8 +1,21 @@
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Renis.Database.Models;
|
||||
|
||||
namespace Renis.Database;
|
||||
|
||||
public class ApplicationContext : DbContext
|
||||
{
|
||||
public DbSet<User> Users { get; set; } = null!;
|
||||
public DbSet<Polis> Polises { get; set; } = null!;
|
||||
public DbSet<UserPolis> UserPolises { get; set; } = null!;
|
||||
public DbSet<Car> Cars { get; set; } = null!;
|
||||
|
||||
public ApplicationContext(DbContextOptions<ApplicationContext> options) : base(options)
|
||||
{
|
||||
Database.EnsureCreated();
|
||||
}
|
||||
|
||||
protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
|
||||
{
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user