} = 10m; // 10m pour preciser qu'il s'agit d'une decimal public decimal GetTotal() { if (!Lignes.Any()) { return(0); } var totalLignes = Lignes.Sum(x => x.Produit.Prix * x.Quantite); // calcul... var fraisPort = totalLignes > 100 ? 0 : 10; // ternaire return(totalLignes + FraisPort); }
private void UpdateLayersDefinitionExpressions() { FeatureLayer featureLayer = _mapView.Map.OperationalLayers.Single((Layer x) => x.Id == _config.Map.LignesLayerId).As <FeatureLayer>(); FeatureLayer featureLayer2 = _mapView.Map.OperationalLayers.Single((Layer x) => x.Id == _config.Map.ArretsLayerId).As <FeatureLayer>(); if (Lignes.Any()) { featureLayer.DefinitionExpression = string.Join(" OR ", Lignes.Select((LigneSens x) => "(Ligne='" + x.Ligne + "' AND Sens='" + x.Sens + "')")); featureLayer2.DefinitionExpression = string.Join(" OR ", Lignes.Select((LigneSens x) => "Ligne='" + x.Ligne + "'")); } else { featureLayer.DefinitionExpression = string.Empty; featureLayer2.DefinitionExpression = string.Empty; } }