public async Task <RiderDto> UpdateAsync(int id, RiderUpdateDto dto) { var entity = await Repository.GetAsync(id) ?? throw new EntityNotFoundException(); ObjectMapper.Map(dto, entity); try { await Repository.UpdateAsync(entity, autoSave : true); } catch (Exception ex) { } return(ObjectMapper.Map <RiderEntity, RiderDto>(entity)); }
public async Task <RiderDto> Update([FromRoute] int id, [FromBody] RiderUpdateDto dto) { return(await RiderAppService.UpdateAsync(id, dto)); }