Refactor to GetOrderPOCO
Getting the data from the Orders table
private void DemoWriteXml()
{
var o = GetOrderPoco(10249);
Shared.XMLHelper.SaveXml(o, @"%TEMP%orders.xml");
}
OrderPoco GetOrderPoco(int orderId)
{
var o = new OrderPoco();
var Orders = new Models.Orders();
Orders.ForEachRow(Orders.OrderID.IsEqualTo(orderId), () =>
{
o.OrderID = Orders.OrderID;
o.CustomerID = Orders.CustomerID.TrimEnd();
o.Shipper = Orders.ShipVia;
});
var Order_Details = new Models.Order_Details();
Order_Details.ForEachRow+(Order_Details.OrderID.IsEqualTo(orderId), () =>
{
o.Details.Add(new OrderDetailsPoco
{
ProductID = Order_Details.ProductID,
Quantity = Order_Details.Quantity,
UnitPrice = Order_Details.UnitPrice
});
});
return o;
}
Help us improve, Edit this page on GitHub
or email us at info@fireflymigration.com