예제 #1
0
        public override string ToString()
        {
            string str = "";

            ProductsWithPrice
            .Select(keyValue => keyValue.Key).ToList()
            .ForEach(product => str += $"{product.Quantity}x {product.ToString()}, ");
            return(str.ToString());
        }
예제 #2
0
 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);
 })));