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)); }