public async void AddCategory(string Name) { Category cat = new Category(); cat.Name = Name; cat.IsActive = true; //send to db Context.Categories.Add(cat); await Context.SaveChangesAsync(); }
public async Task<JsonResult> _Edit(Category cat) { await Task.Run(() => _service.EditCategory(cat.Name, cat.Id)); return Json(true); }