Example #1
0
        public static OrderFoundViewModel CreateFromOrder(Order order)
        {
            if (order == null)
                return new OrderFoundViewModel();

            var model = new OrderFoundViewModel()
            {
                Id = order.OrderId,
                State = order.State,
                OrderDate = order.Date,
                Total = order.Total.ToString()
            };
            foreach (var item in order.Items)
            {
                model.Details.Add(item);
            }
            return model;
        }
Example #2
0
        public static OrderFoundViewModel CreateFromOrder(Order order)
        {
            if (order == null)
            {
                return(new OrderFoundViewModel());
            }

            var model = new OrderFoundViewModel()
            {
                Id        = order.OrderId,
                State     = order.State,
                OrderDate = order.Date,
                Total     = order.Total.ToString()
            };

            foreach (var item in order.Items)
            {
                model.Details.Add(item);
            }
            return(model);
        }