Beispiel #1
0
 public static Task <T> GetObjectAsync <T>(
     this HttpService http, string url, CancellationToken cancellationToken,
     CacheMode?cache = null, string?cacheKey = null, bool?repeat = null, int?timeoutSeconds = null)
     where T : class, new() =>
 http.GetObjectAsync <T>(new Uri(url), cancellationToken,
                         cache : cache, cacheKey : cacheKey, repeat : repeat, timeoutSeconds : timeoutSeconds);
Beispiel #2
0
 public static Task <dynamic> GetObjectAsync(
     this HttpService http, Uri uri, CancellationToken cancellationToken,
     CacheMode?cache = null, string?cacheKey = null, bool?repeat = null, int?timeoutSeconds = null) =>
 http.GetObjectAsync <object>(uri, cancellationToken,
                              cache: cache, cacheKey: cacheKey, repeat: repeat, timeoutSeconds: timeoutSeconds);
Beispiel #3
0
 public static T GetObject <T>(
     this HttpService http, Uri uri,
     CacheMode?cache = null, string?cacheKey = null, bool?repeat = null, int?timeoutSeconds = null)
     where T : class, new() =>
 Task.Run(() => http.GetObjectAsync <T>(uri, Kit.CancellationToken,
                                        cache : cache, cacheKey : cacheKey, repeat : repeat, timeoutSeconds : timeoutSeconds)).Result;
Beispiel #4
0
 public static dynamic GetObject(
     this HttpService http, string url,
     CacheMode?cache = null, string?cacheKey = null, bool?repeat = null, int?timeoutSeconds = null) =>
 Task.Run(() => http.GetObjectAsync <object>(new Uri(url), Kit.CancellationToken,
                                             cache: cache, cacheKey: cacheKey, repeat: repeat, timeoutSeconds: timeoutSeconds)).Result;