예제 #1
0
        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));
        }
예제 #2
0
 public async Task <RiderDto> Update([FromRoute] int id, [FromBody] RiderUpdateDto dto)
 {
     return(await RiderAppService.UpdateAsync(id, dto));
 }