21 lines
599 B
C#
21 lines
599 B
C#
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)
|
|
{
|
|
}
|
|
} |