Exemplo n.º 1
0
        public static Order toGrpc(model.Order model)
        {
            var result = new Order
            {
                BuyerId = model.BuyerId,
                IdOrder = model.IdOrder
            };

            result.Lines.AddRange(model.Lines);
            result.States.AddRange(model.States.Select(s => new OrderState
            {
                State = s.Name,
                Data  = s.Data
            }));
            return(result);
        }