todo stage1
This commit is contained in:
22
MySolution/ToDoApp/Service/DbService.cs
Normal file
22
MySolution/ToDoApp/Service/DbService.cs
Normal file
@@ -0,0 +1,22 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using ToDoApp.Context;
|
||||
|
||||
namespace ToDoApp.Service
|
||||
{
|
||||
public class DbService
|
||||
{
|
||||
public static DbService Instance { get; set; } = new DbService();
|
||||
|
||||
public void EnsureCreated()
|
||||
{
|
||||
using (var context = new ToDoContext())
|
||||
{
|
||||
context.Database.EnsureCreated();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user