AgGateway.ADAPT.ISOv4Plugin.Loaders.PrescriptionLoader.LoadProducts C# (CSharp) Метод

LoadProducts() приватный Метод

private LoadProducts ( TreatmentZone treatmentZone, AgGateway.ADAPT.ApplicationDataModel.Prescriptions.RasterGridPrescription prescription ) : void
treatmentZone AgGateway.ADAPT.ISOv4Plugin.Models.TreatmentZone
prescription AgGateway.ADAPT.ApplicationDataModel.Prescriptions.RasterGridPrescription
Результат void
        private void LoadProducts(TreatmentZone treatmentZone, RasterGridPrescription prescription)
        {
            var productIds = new List<int>();
            foreach (var dataVariable in treatmentZone.Variables)
            {
                Product product = _taskDocument.CropVarieties.FindById(dataVariable.ProductId)
                                    ?? (_taskDocument.Products.FindById(dataVariable.ProductId)
                                    ?? _taskDocument.ProductMixes.FindById(dataVariable.ProductId));
                productIds.Add(product == null ? 0 : product.Id.ReferenceId);
            }
            prescription.ProductIds = productIds;
        }