public async Task <BaseResponse> UpdatePhysican(Physican physican) { try { var resphysican = await _dBContext.Physican.AsNoTracking().Where(p => p.PhysicianId == physican.PhysicianId).FirstOrDefaultAsync(); if (resphysican == null) { _dBContext.Physican.Add(physican); await _dBContext.SaveChangesAsync(); } else { _dBContext.Physican.UpdateRange(physican); await _dBContext.SaveChangesAsync(); } return(new BaseResponse() { StatusCode = StatusCodes.Status202Accepted, StatusDescription = " Physican Details Updated Successfully! ", ID = physican.PhysicianId }); } catch (Exception ex) { Log.Error("Exception occurred on Update Physican By ID", ex); return(new BaseResponse { StatusCode = StatusCodes.Status500InternalServerError, StatusDescription = "Internal Server Error" }); } }
public async Task <BaseResponse> UpdatePhysican(Physican physican) { return(await _physicanRepository.UpdatePhysican(physican)); }