Files
dotNetStudyWithGPT/MySolution/ToDoApp/Service/DbService.cs

23 lines
473 B
C#
Raw Normal View History

2023-10-27 18:07:18 +09:00
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();
}
}
}
}