示例#1
0
 static void Main(string[] args)
 {
     using (var context = new TodoListContext())
     {
         var category = new Category()
         {
             Name = "Test",
         };
         context.Categories.Add(category);
         context.SaveChanges();
     }
 }
 public void InsertCategory(Category category) 
 {
     this.categories.Add(category);
 }
 public void UpdateCategory(Category category)
 {
     this.categories.Update(category.CategoryId, category);
 }
 public void DeleteCategory(Category category) 
 {
     this.categories.Delete(category.CategoryId);
 }