Ejemplo n.º 1
0
        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");
        }