public override Task <GetDescriptionResponse> GetDescription(GetDescriptionRequest request,
                                                                     ServerCallContext context)
        {
            var returnObject = returnObjectStore.GetObject(request.ReturnObject.Id);

            return(Task.FromResult(new GetDescriptionResponse {
                Description = returnObject.GetDescription()
            }));
        }
예제 #2
0
        /// <summary>
        ///     Return cached object without deserialization to .NET object. Used to process data at json level
        /// </summary>
        /// <param name="query"></param>
        /// <returns></returns>
        public IList <CachedObject> GetObjectDescriptions(OrQuery query)
        {
            var exceptions = new List <ExceptionResponse>();
            var result     = new List <CachedObject>();
            var request    = new GetDescriptionRequest(query);

            Channel.SendStreamRequest(request, (CachedObject item, int currentItem, int totalItems) => result.Add(item),
                                      exceptions.Add);


            if (exceptions.Count > 0)
            {
                throw new CacheException("Error in GetObjectDescriptions", exceptions[0].Message,
                                         exceptions[0].CallStack);
            }

            return(result);
        }
예제 #3
0
 public async Task <GetDescriptionResponse> GetDescription([FromUri] GetDescriptionRequest request)
 {
     return(await Invoke(request, Repository.GetDescription));
 }