예제 #1
0
        public async Task <List <HubInfo> > GetSharedContentAsync(HubSelectRequest request = null)
        {
            try
            {
                if (request == null)
                {
                    request = new HubSelectRequest();
                }

                var result = await SendRequestAsync("sharedcontent/full", HttpMethod.Get, null, request.Filter, request.OrderBy);

                return(JsonConvert.DeserializeObject <List <HubInfo> >(result));
            }
            catch (Exception ex)
            {
                logger.Error(ex, $"The method \"{nameof(GetSharedContentAsync)}\" failed.");
                return(null);
            }
        }
예제 #2
0
        public async Task <int> GetSharedContentCountAsync(HubSelectCountRequest request = null)
        {
            try
            {
                if (request == null)
                {
                    request = new HubSelectRequest();
                }

                var result = await SendRequestAsync("sharedcontent/count", HttpMethod.Get, null, request.Filter);

                var count = JsonConvert.DeserializeObject <JToken>(result).Value <int>("value");
                logger.Debug($"SharedContentCount: {count}");
                return(count);
            }
            catch (Exception ex)
            {
                logger.Error(ex, $"The method \"{nameof(GetSharedContentCountAsync)}\" failed.");
                return(-1);
            }
        }