/// <summary> /// Transforms a Order object into a DOrder object. /// </summary> /// <param name="order">Order to transform.</param> /// <returns>The new DOrder object.</returns> static public DOrder ToDOrder(Order order) { DOrder toReturn = new DOrder(order.Product, order.Amount); toReturn.Id = order.Id; return(toReturn); }
/// <summary> /// Transforms a DOrder object to a Order object. /// </summary> /// <param name="dOrder">DOrder to transforms.</param> /// <param name="client">Client who made the order.</param> /// <returns>The new Order object.</returns> static public Order ToOrder(DOrder dOrder, Client client) { Order toReturn = new Order(dOrder.Product, dOrder.Amount, client); toReturn.Id = dOrder.Id; return(toReturn); }