Beispiel #1
0
        public async Task UpdateEntityAttributeAsync(int entityAttributeTypeId, int entityAttributeId, EntityAttributeDto entityAttributeDto)
        {
            //if (entityAttributeDto.EntityAttributeTypeId == null)
            //         {
            //             throw new BadRequestException("EntityAttributeTypeId cannot be null");
            //         }

            //var entityAttributeType = await _entityAttributeTypeRepository.GetEntityAttributeTypeByIdAsync(entityAttributeTypeId);
            //         if (entityAttributeType == null)
            //         {
            //	throw new NotFoundException("EntityAttributeType not found.");
            //         }

            //var entityAttribute = entityAttributeType.EntityAttributes.SingleOrDefault(e => e.Id == entityAttributeId);
            //if (entityAttribute == null)
            //{
            //	throw new NotFoundException("EntityAttribute not found.");
            //}

            //entityAttribute.Update(entityAttributeDto.EntityAttributeTypeId.Value, entityAttributeDto.ParentId, entityAttributeDto.Value, entityAttributeDto.IsSearchable);
            //await _entityAttributeRepository.SaveAsync();
            throw new Exception();
        }
Beispiel #2
0
        public async Task <IActionResult> UpdateEntityAttribute(int entityAttributeTypeId, int entityAttributeId, [FromBody] EntityAttributeDto entityAttributeDto)
        {
            try
            {
                await _courseAttributeService.UpdateEntityAttributeAsync(entityAttributeTypeId, entityAttributeId, entityAttributeDto);

                return(NoContent());
            }
            catch (NotFoundException ex)
            {
                return(NotFound(ex.Message));
            }
            catch (BadRequestException ex)
            {
                return(BadRequest(ex.Message));
            }
            catch (Exception ex)
            {
                _logger.LogCritical($"UpdateEntityAttribute() error {ex}");
                return(StatusCode(500, "Internal Server Error: " + ex.Message));
            }
        }
Beispiel #3
0
 public async Task CreateEntityAttributeAsync(int entityAttributeTypeId, EntityAttributeDto entityAttributeDto)
 {
     throw new Exception();
 }