Example #1
0
        public async Task <IActionResult> Post([FromBody] Factory factory)
        {
            if (await IsFactoryExist(factory.Id))
            {
                return(StatusCode(409, "Provided factory exist"));
            }

            await _factoryService.CreateAsync(factory.Id, factory.Name);

            return(Created($"Factory/{factory.Id}", null));
        }