From 459d11dd6b35b2accca474ca97619dd254686545 Mon Sep 17 00:00:00 2001 From: Polianin Nikita Date: Fri, 26 Jan 2024 19:37:42 +0300 Subject: [PATCH] feat: add a database creation class (initial) --- Persistence/DbInitializer.cs | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 Persistence/DbInitializer.cs diff --git a/Persistence/DbInitializer.cs b/Persistence/DbInitializer.cs new file mode 100644 index 0000000..87f3a9b --- /dev/null +++ b/Persistence/DbInitializer.cs @@ -0,0 +1,11 @@ +using Microsoft.EntityFrameworkCore; + +namespace Mirea.Api.DataAccess.Persistence; + +public static class DbInitializer +{ + public static void Initialize(DbContext dbContext) + { + dbContext.Database.EnsureCreated(); + } +} \ No newline at end of file