renis-backend/Database/ApplicationContext.cs
2024-09-07 11:46:57 +03:00

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)
{
}
}