public static ContentTypeDto ToConditionTypeDto(this UpdateContentTypeDto updateContentTypeDto, Guid tenantId, int code) => new ContentTypeDto
 {
     Code     = code,
     Name     = updateContentTypeDto.Name,
     TenantId = tenantId
 };
Пример #2
0
        public async Task <IActionResult> Update([FromRoute] Guid tenantId, [FromRoute] int code, [FromBody] UpdateContentTypeDto updateContentTypeDto)
        {
            try
            {
                ContentTypeDto conditionTypeDto = await this.contentTypeService.Update(updateContentTypeDto.ToConditionTypeDto(tenantId, code));

                return(this.Ok(conditionTypeDto));
            }
            catch (NotFoundException)
            {
                return(this.NotFound("A content type w/ the given id was not found"));
            }
        }