2024-09-07 08:44:30 +00:00
|
|
|
using Microsoft.EntityFrameworkCore;
|
2024-09-07 08:46:57 +00:00
|
|
|
using Renis.Database.Models;
|
2024-09-07 08:44:30 +00:00
|
|
|
|
|
|
|
namespace Renis.Database;
|
|
|
|
|
|
|
|
public class ApplicationContext : DbContext
|
|
|
|
{
|
2024-09-07 08:46:57 +00:00
|
|
|
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!;
|
2024-09-07 08:44:30 +00:00
|
|
|
|
2024-09-07 08:46:57 +00:00
|
|
|
public ApplicationContext(DbContextOptions<ApplicationContext> options) : base(options)
|
|
|
|
{
|
|
|
|
Database.EnsureCreated();
|
|
|
|
}
|
|
|
|
|
|
|
|
protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
|
|
|
|
{
|
|
|
|
}
|
2024-09-07 08:44:30 +00:00
|
|
|
}
|