public async Task <IActionResult> Create([FromBody] Plant plant) { if (_plantService.IsExisting(plant)) { return(StatusCode((int)HttpStatusCode.Conflict)); } _repository.Add(plant); _repository.Save(); await _plantService.PublishSaveEventAsync(plant); return(CreatedAtRoute("GetPlant", new { id = plant.Id }, Mapper.Map <Plant, PlantGetDto>(plant))); }