Ejemplo n.º 1
0
 private CatalogItem MapToCatalogItemResponse(CatalogItemResponse catalogItemResponse)
 {
     return(new CatalogItem
     {
         Id = catalogItemResponse.Id,
         Name = catalogItemResponse.Name,
         PictureUri = catalogItemResponse.PictureUri,
         Price = (decimal)catalogItemResponse.Price
     });
 }
Ejemplo n.º 2
0
        public override Task <CatalogItemResponse> GetInfoBy(CatalogItemRequest request, ServerCallContext context)
        {
            var random = new Random();

            var response = new CatalogItemResponse
            {
                Id          = request.Id,
                Description = "This is description",
                Title       = "Title",
                Price       = random.Next()
            };

            return(Task.FromResult(response));
        }