Exemplo n.º 1
0
        public async Task UpdateEntityAttributeTypeAsync(int entityAttributeTypeId, EntityAttributeTypeDto newType)
        {
            var entityAttributeType = await _entityAttributeTypeRepository.GetEntityAttributeTypeByIdAsync(entityAttributeTypeId);

            if (entityAttributeType == null)
            {
                throw new NotFoundException();
            }

            entityAttributeType.Name = newType.Name;
            await _entityAttributeTypeRepository.SaveAsync();
        }
Exemplo n.º 2
0
        public async Task <IActionResult> CreateEntityAttributeType([FromBody] EntityAttributeTypeDto dto)
        {
            try
            {
                await _courseAttributeService.CreateEntityAttributeTypeAsync(dto);

                return(NoContent());
            }
            catch (NotFoundException ex)
            {
                return(NotFound(ex.Message));
            }
            catch (BadRequestException ex)
            {
                return(BadRequest(ex.Message));
            }
            catch (Exception ex)
            {
                _logger.LogCritical($"CreateEntityAttributeType() error {ex}");
                return(StatusCode(500, "Internal Server Error: " + ex.Message));
            }
        }
Exemplo n.º 3
0
 public async Task CreateEntityAttributeTypeAsync(EntityAttributeTypeDto dto)
 {
     throw new Exception();
 }