/// <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(); }
/// <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(); }