/// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task <IList <BestStoryInfo> > GetAllBestStoriesInfoAsync(this IHackerNewsAPI operations, CancellationToken cancellationToken = default(CancellationToken))
 {
     using (var _result = await operations.GetAllBestStoriesInfoWithHttpMessagesAsync(null, cancellationToken).ConfigureAwait(false))
     {
         return(_result.Body);
     }
 }
 public HackerNewsClientTests()
 {
     _api        = new HackerNewsMockAPI();
     _localCache = new MemoryCache(Options.Create(new MemoryCacheOptions()));
     _distCache  = new MemoryDistributedCache(Options.Create(new MemoryDistributedCacheOptions()));
     _client     = new HackerNewsClient(_api, _localCache, _distCache);
 }
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 public static IList <BestStoryInfo> GetAllBestStoriesInfo(this IHackerNewsAPI operations)
 {
     return(Task.Factory.StartNew(s => ((IHackerNewsAPI)s).GetAllBestStoriesInfoAsync(), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult());
 }
Exemplo n.º 4
0
 public HackerNewsController(IHackerNewsAPI service, IMemoryCache cache)
 {
     _service = service;
     _cache   = cache;
 }
Exemplo n.º 5
0
 public NewsController(IHackerNewsAPI hackerNewsAPI)
 {
     _hackerNewsAPI = hackerNewsAPI;
 }
Exemplo n.º 6
0
 public HackerNewsClient(IHackerNewsAPI api, IMemoryCache localCache, IDistributedCache distCache)
 {
     _api        = api;
     _localCache = localCache;
     _distCache  = distCache;
 }