Пример #1
0
 /// <summary>
 /// Updates the category.
 /// </summary>
 /// <param name="category">The category.</param>
 /// <returns></returns>
 public async Task UpdateCategory(Category category)
 {
     context.Entry(category).State = EntityState.Modified;
     await context.SaveChangesAsync();
 }
Пример #2
0
 /// <summary>
 /// Inserts the category.
 /// </summary>
 /// <param name="category">The category.</param>
 /// <returns></returns>
 public async Task InsertCategory(Category category)
 {
     category.Deleted = false;
     context.Categories.Add(category);
     await context.SaveChangesAsync();
 }