public bool UpdateProduction(ProductionEntity productionModel) { var productionToUpdate = _dbContext.Productions.FirstOrDefault(c => c.Id == productionModel.Id); _dbContext.Entry(productionToUpdate).CurrentValues.SetValues(productionModel); /*if (productionModel.Name != null) * { * _dbContext.Entry(productionModel).Property(p => p.Name).IsModified = true; * }*/ return(true); }
//Productions public void CreateProduction(ProductionEntity production) { _dbContext.Productions.Add(production); }