public IActionResult Put(long id, [FromBody] Division division) { if (division == null) { return(BadRequest()); } if (!db.Divisions.Any(x => x.Id == division.Id)) { return(NotFound()); } division.DateTime = DateTime.Now; db.Update(division); db.SaveChanges(); return(Ok(division)); }
public IActionResult Put(long id, [FromBody] Realtor realtor) { if (realtor == null) { return(BadRequest()); } if (!db.Realtors.Any(x => x.Id == realtor.Id)) { return(NotFound()); } realtor.DateTime = DateTime.Now; db.Update(realtor); db.SaveChanges(); return(Ok(realtor)); }