Esempio n. 1
0
        public static internalDTO.Order MapFromBLL(externalDTO.Order order)
        {
            var res = order == null ? null : new internalDTO.Order
            {
                Id                = order.Id,
                Description       = order.Description,
                OrderCreationTime = order.OrderCreationTime,
                ShipperId         = order.ShipperId,
                Shipper           = ShipperMapper.MapFromBLL(order.Shipper),
                ShopId            = order.ShopId,
                Shop              = ShopMapper.MapFromBLL(order.Shop),
            };

            return(res);
        }
Esempio n. 2
0
        public static externalDTO.Order MapFromDAL(internalDTO.Order order)
        {
            var res = order == null ? null : new externalDTO.Order
            {
                Id                = order.Id,
                Description       = order.Description,
                OrderCreationTime = order.OrderCreationTime,
                ShipperId         = order.ShipperId,
                Shipper           = ShipperMapper.MapFromDAL(order.Shipper),
                ShopId            = order.ShopId,
                Shop              = ShopMapper.MapFromDAL(order.Shop),
            };

            if (order?.ProductsInOrder != null)
            {
                res.ProductsInOrder = order.ProductsInOrder.Select(e => ProductInOrderMapper.MapFromDAL(e)).ToList();
            }

            return(res);
        }