public IActionResult Update(long id, CreateUpdateGroup model) { var group = db.Groups.First(s => s.Id == id); group.Name = model.Name; db.Update(group); db.SaveChanges(); return(Ok(group)); }
public IActionResult Create(CreateUpdateGroup model) { var group = new Group() { Name = model.Name }; db.Add(group); db.SaveChanges(); return(Ok(group)); }