public async Task <IActionResult> PutAsync(int id, [FromBody] Admins user) { if (await _repo.GetAdminByIdAsync(id) is Domain.Models.Admins u) { var resource = Mapper.MapAdmins(user); await _repo.UpdateAdminAsync(id, resource); await _repo.SaveAsync(); var newEntity = await _repo.GetAdminByIdAsync(id); return(Ok(newEntity)); } return(NotFound("Admin doesn't exist")); }