Esempio n. 1
0
        public async Task <IActionResult> UpdateAsync([FromBody] EditLykkeEntityModel model)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(new ErrorResponse().AddErrors(ModelState)));
            }

            try
            {
                var lykkeEntity = Mapper.Map <LykkeEntity>(model);

                await _lykkeEntityService.UpdateAsync(lykkeEntity);
            }
            catch (LykkeEntityNotFoundException exception)
            {
                _log.Error(exception, context: model);
                return(NotFound(ErrorResponse.Create(exception.Message)));
            }

            return(NoContent());
        }
Esempio n. 2
0
 public async Task UpdateLykkeEntityAsync(EditLykkeEntityModel model)
 {
     await _runner.RunAsync(() => _lykkeEntitiesApi.UpdateAsync(model));
 }