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(); }
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)); } }
public async Task CreateEntityAttributeTypeAsync(EntityAttributeTypeDto dto) { throw new Exception(); }