todo-app-backend/TodoApp/API/Data/TodoAppDataSeeder.cs
JakubWalkowiak bfb86df000 initial app
2022-02-08 22:12:18 +01:00

34 lines
650 B
C#

using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using TodoApp.API.Models;
namespace TodoApp.API.Data
{
public class TodoAppDataSeeder
{
public static void Initialize(TodoAppContext context)
{
if (context.TodoItems.Any())
{
return;
}
context.TodoItems.AddRange(
new TodoItem
{
Name = "Test",
Done = false,
Description = "Test"
}
);
context.SaveChanges();
}
}
}