Esempio n. 1
0
        public OrderService.Order ToGrpc()
        {
            var order = new OrderService.Order();

            order.Id          = OrderId;
            order.CreatedTime = Timestamp.FromDateTimeOffset(CreatedTime);
            if (order.DeliveryAddress?.Name != null)
            {
                order.DeliveryAddress = DeliveryAddress?.ToGrpc();
            }
            order.DeliveryLocation = new Google.Type.LatLng()
            {
                Latitude  = DeliveryLocation.Latitude,
                Longitude = DeliveryLocation.Longitude,
            };
            order.Pizzas.Add(Pizzas.Select(p => p.ToGrpc()));
            return(order);
        }