public async Task <ProductionModel> CreateProductionAsync(ProductionModel productionModel) { var productionEntity = _mapper.Map <ProductionEntity>(productionModel); _libraryRepository.CreateProduction(productionEntity); var result = await _libraryRepository.SaveChangesAsync(); if (result) { return(_mapper.Map <ProductionModel>(productionEntity)); } throw new Exception("Database Error"); }