Beispiel #1
0
 public virtual void AddSubstance(int sortOrder, Substance substance, Decimal quantity, Unit unit)
 {
     GetSubstances().Add(new ProductSubstance(this, sortOrder, substance, quantity, unit));
 }
 public ProductSubstance(Product product, int sortOrder, Substance substance, decimal quantity, Unit unit)
 {
     Initialize(product, sortOrder, substance, quantity, unit);
 }
 private void SetSubstance(Substance substance)
 {
     _substance = substance;
     _substance.AddProduct(_product);
 }
        internal static ProductSubstance Create(ProductSubstanceDto dto, Product product, Substance substance, UnitValue quantity)
        {
            var prodSubst = new ProductSubstance
            {
                Product   = product,
                Substance = substance,
                Name      = dto.Name,
                Quantity  = quantity,
                SortOrder = dto.SortOrder
            };

            Validate(prodSubst);
            return(prodSubst);
        }