예제 #1
0
        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();
        }
예제 #2
0
 public void Add(TodoItem item)
 {
     _context.Add(item);
     _context.SaveChanges();
 }