public override string ToString() { string str = ""; ProductsWithPrice .Select(keyValue => keyValue.Key).ToList() .ForEach(product => str += $"{product.Quantity}x {product.ToString()}, "); return(str.ToString()); }
public XElement ToXml() => new XElement("procurement", new XElement("recieveDate", RecieveDate), new XElement("paymentDate", PaymentDate), new XElement("isRecieved", IsRecieved), new XElement("products", ProductsWithPrice.Select(product => { XElement xElement = product.Key.ToXml(); xElement.Add(new XAttribute("price", product.Value)); return(xElement); })));