public IActionResult EditUser(User user) { if (user.Id == 0) { _bdc.Add(user); } else { _bdc.Update(user); } _bdc.SaveChanges(); return(RedirectToAction("Index")); }
public IActionResult Put([FromBody] string term, User user) { var dbu = _bdc.Users.SingleOrDefault(u => u.FullName == term); if (dbu != null) { //dbu.Activities = term.Activities; _bdc.Update(dbu); _bdc.SaveChanges(); return(Ok()); } else { return(NotFound()); } }