From dafcfab6a7a7a3d53e830158984f8e4d4388f864 Mon Sep 17 00:00:00 2001 From: Nikolai Papin Date: Sat, 7 Sep 2024 11:46:57 +0300 Subject: [PATCH] ApplicationContext db sets --- Database/ApplicationContext.cs | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/Database/ApplicationContext.cs b/Database/ApplicationContext.cs index 5b10ea1..bc6c93b 100644 --- a/Database/ApplicationContext.cs +++ b/Database/ApplicationContext.cs @@ -1,8 +1,21 @@ using Microsoft.EntityFrameworkCore; +using Renis.Database.Models; namespace Renis.Database; public class ApplicationContext : DbContext { + public DbSet Users { get; set; } = null!; + public DbSet Polises { get; set; } = null!; + public DbSet UserPolises { get; set; } = null!; + public DbSet Cars { get; set; } = null!; + public ApplicationContext(DbContextOptions options) : base(options) + { + Database.EnsureCreated(); + } + + protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder) + { + } } \ No newline at end of file