Пример #1
0
        public async Task <ConfigurationPC> Add(AddConfigurationPCCommand command)
        {
            var configurationPC = new ConfigurationPC
            {
                Id          = Guid.NewGuid(),
                Name        = command.Name,
                Description = command.Description,
                ImagePath   = command.ImagePath,
            };

            configurationPC.Components = createConfigurationComponents(command.Components, configurationPC.Id);

            await _configurationPCRepository.Add(configurationPC);

            return(configurationPC);
        }
Пример #2
0
        public async Task <ActionResult> Post([FromBody] AddConfigurationPCCommand command)
        {
            var result = await _configurationPCService.Add(command);

            return(Ok(result));
        }