public async Task <IActionResult> Edit([FromBody] UserViewModel model) { var map = mapper.Map <User>(model); context.Entry(map).State = EntityState.Modified; await context.SaveChangesAsync(); return(Ok()); }
public async Task <IActionResult> Edit([FromBody] DepartmentsViewModel model) { if (!ModelState.IsValid) { return(BadRequest()); } var map = mapper.Map <Department>(model); context.Entry(map).State = EntityState.Modified; await context.SaveChangesAsync(); return(Ok()); }