public DbSeeder(TodoContext dbcontext) { /* * User user = new User() * { * Id = Guid.NewGuid().ToString(), * Name = "Daryl Kouk", * Username = "******", * Password = encoder.Encode("Password") * }; * dbcontext.Add(user);*/ TodoItem tdi = new TodoItem() { Name = "Cook dinner", IsComplete = false, Secret = "Dangerous Secret info" }; dbcontext.Add(tdi); dbcontext.SaveChanges(); }
public void Add(TodoItem item) { _context.Add(item); _context.SaveChanges(); }