Esempio n. 1
0
        private async Task <CustomFieldReferenceDto> CreateSampleCustomField()
        {
            var dto = new CustomFieldAddRequest
            {
                Name      = "Test Custom Field",
                FieldType = Database.Common.CustomFieldType.Text
            };
            var fieldRef = (await _commandService.Create(dto)).Value;

            await SaveChanges();

            return(fieldRef);
        }
Esempio n. 2
0
        private async Task <string> CreateCustomField(Database.Common.CustomFieldType type)
        {
            var dto = new CustomFieldAddRequest
            {
                Name      = "Test Custom Field 1",
                FieldType = type
            };
            var customField = (await _customFieldCommandService.Create(dto)).Value;

            await SaveChanges();

            return(customField.Id);
        }
Esempio n. 3
0
        private async Task <string> CreateSampleCustomField()
        {
            var dto = new CustomFieldAddRequest
            {
                Name      = "Test Custom Field" + GetRandomString(),
                FieldType = Database.Common.CustomFieldType.Text
            };

            var(fieldRef, _) = await _commandService.Create(dto);
            await SaveChanges();

            return(fieldRef.Id);
        }
 public Task <ActionResult <CustomFieldReferenceDto> > Create([FromServices] ICustomFieldCommandService service,
                                                              CustomFieldAddRequest dto)
 => service.Create(dto).ToActionResultOfT();