public virtual async Task <IActionResult> OnPostAsync()
        {
            var dto = ObjectMapper.Map <EditModelDefinitionViewModel, UpdateModelDefinitionDto>(ViewModel);
            await _modelDefinitionService.UpdateAsync(Id, dto);

            return(NoContent());
        }
Exemple #2
0
        public async Task ShouldCheckDuplicateName_Update()
        {
            // Arrange
            var id = (await _modelDefinitionRepository.InsertAsync(new ModelDefinition(Guid.NewGuid(), "book2", "Book2", "DynamicEntity.Book2"))).Id;

            // Act
            var ex = await Assert.ThrowsAsync <BusinessException>(() => _modelDefinitionAppService.UpdateAsync(id, new CreateUpdateModelDefinitionDto
            {
                Name        = "book",
                DisplayName = "Book",
                Type        = "DynamicEntity.Book"
            }));

            // Assert
            ex.Code.ShouldBe(DynamicEntityErrorCodes.ModelDefinitionAlreadyExists);
        }
Exemple #3
0
 public virtual Task <ModelDefinitionDto> UpdateAsync(Guid id, UpdateModelDefinitionDto input)
 {
     return(_service.UpdateAsync(id, input));
 }