PIbd-22. Katysheva N.E LabWork2 #3

Closed
revengel66 wants to merge 18 commits from lab2 into lab1
2 changed files with 4 additions and 12 deletions
Showing only changes of commit 7314b5ca99 - Show all commits

View File

@ -1,9 +1,4 @@
using PizzeriaFileImplement.Models;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Xml.Linq;
namespace PizzeriaFileImplement

View File

@ -71,13 +71,10 @@ namespace PizzeriaFileImplement.Models
PizzaComponents = PizzaComponents
};
public XElement GetXElement => new("Pizza",
new XAttribute("Id", Id),
new XElement("PizzaName", PizzaName),
new XElement("Price", Price.ToString()),
new XElement("PizzaComponents", Components.Select(x => new XElement("PizzaComponent",
new XElement("Key", x.Key),
new XElement("Value", x.Value)))
.ToArray()));
new XAttribute("Id", Id),
new XElement("PizzaName", PizzaName),
new XElement("Price", Price.ToString()),
new XElement("PizzaComponents", Components.Select(x => new XElement("PizzaComponent", new XElement("Key", x.Key), new XElement("Value", x.Value))).ToArray()));
}
}