23 lines
473 B
C#
23 lines
473 B
C#
|
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();
|
|||
|
}
|
|||
|
}
|
|||
|
}
|
|||
|
}
|