putempdetail编辑api中的错误不起作用
[HttpPut]
[Route("PutEmpDetail")]
public async Task<actionResult<EmpDetail>> PutEmpDetail(int id,EmpDetail empDetail)
{
var obj = _empcontext.EmpDetails.Where(x => x.Id == empDetail.Id).FirstOrDefault();
if (obj != null)
{
obj.empcode = empDetail.empcode;
obj.empname = empDetail.empname;
obj.salary = empDetail.salary;
await _empcontext.SaveChangesAsync();
return CreatedAtaction("GetempDetail",empDetail);
}
}
putempdetail编辑api中的错误不起作用