Beispiel #1
0
        public static void Initialize(IServiceProvider serviceProvider)
        {
            using (var context = new TodoListContext(serviceProvider.
                                                     GetRequiredService <DbContextOptions <TodoListContext> >()))
            {
                if (context.TodoList.Any())
                {
                    return;
                }

                context.SaveChanges();
            }
        }
Beispiel #2
0
 public SqlTodoListData(TodoListContext db)
 {
     this.db = db;
 }