public Responsible Update(ResponsibleRequest req) { Responsible responsible = db.Responsibles.Find(req.Id); responsible.Name = req.Name; responsible.Email = req.Email; db.SaveChanges(); return(responsible); }
public IHttpActionResult PutResponsible(ResponsibleRequest req) { try { Responsible responsible = db.Responsibles.Find(req.Id); if (responsible == null) { return(NotFound()); } UpdateResponsible resp = new UpdateResponsible(); return(Ok(resp.Update(req))); }catch (Exception e) { return(InternalServerError()); } }