Example #1
0
        public static Domain.Order MapFromDAL(DAL.App.DTO.DomainLikeDTO.Order order)
        {
            var res = order == null ? null : new Domain.Order
            {
                Id                = order.Id,
                Description       = new MultiLangString(order.Description),
                OrderCreationTime = order.OrderCreationTime,
                ShipperId         = order.ShipperId,
                Shipper           = ShipperMapper.MapFromDAL(order.Shipper),
                ShopId            = order.ShopId,
                Shop              = ShopMapper.MapFromDAL(order.Shop)
            };

            return(res);
        }
Example #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);
        }