public async Task <ActionResult> EditServGroup(int id) { ServGroup content = await Task.Run(() => Context.ServGroup.Where(x => x.id == id).ToList()[0]); ViewBag.Title = content.name; return(View(content)); }
public async Task <ActionResult> EditServGroup(ServGroup group, string command = "", string modalCommand = "") { if (command.Equals("Save")) { if (ModelState.IsValid) { Context.Entry(group).State = EntityState.Modified; await Context.SaveChangesAsync(); ViewBag.Title = group.name; } return(View(group)); } //else if (command.Equals("Exit")) //{ // return RedirectToAction("ServGroupsAll"); //} return(RedirectToAction("ServGroupsAll")); }