Esempio n. 1
0
        public IEnumerable <SupplyItem> GetSupplies()
        {
            var data = new SupplyData();

            return(data.GetItems().Select(i => new SupplyItem
            {
                Code = i.Code,
                Description = i.Description,
                Available = i.Available,
                Price = i.Price
            }));
        }
        public override Task <GetSuppliesResponse> GetSupplies(GetSuppliesRequest request, ServerCallContext context)
        {
            var response = new GetSuppliesResponse
            {
                Items =
                {
                    _data.GetItems().Select(i => new SupplyItem
                    {
                        Code        = i.Code,
                        Description = i.Description,
                        Available   = i.Available,
                        Price       = Convert.ToDouble(i.Price)
                    })
                }
            };

            return(Task.FromResult(response));
        }