Spontaneous.DataModel.NutritionFacts.operator C# (CSharp) Méthode

operator() public static méthode

public static operator ( ) : NutritionFacts
Résultat NutritionFacts
        public static NutritionFacts operator *(NutritionFacts nut, double weight)
        {
            return new NutritionFacts()
            {
                Calories = nut.Calories * weight,
                TotalCarbohydrate = nut.TotalCarbohydrate * weight,
                TotalFat = nut.TotalFat * weight,
                SaturatedFat = nut.SaturatedFat * weight,
                Protein = nut.Protein * weight,
                Cholesterol = nut.Cholesterol * weight,
                Sugars = nut.Sugars * weight,
                Sodium = nut.Sodium * weight
            };
        }