protected static async Task<IRootResourceObject> GetFreshRootResourceAsync(IHalHttpClient client, IHalHttpClientConfiguration config) { if (config.BaseAddress == null) throw new InvalidOperationException("The root resource can only be requested for caching if the BaseAddress of the client is initialized in the Configure method of the factory."); return await client.GetAsync(config.BaseAddress).ConfigureAwait(false); }
protected static async Task <IRootResourceObject> GetFreshRootResourceAsync(IHalHttpClient client, IHalHttpClientConfiguration config) { if (config.BaseAddress == null) { throw new InvalidOperationException("The root resource can only be requested for caching if the BaseAddress of the client is initialized in the Configure method of the factory."); } return(await client.GetAsync(config.BaseAddress).ConfigureAwait(false)); }
protected virtual IHalHttpClient Decorate(IHalHttpClient original) { return(original); // return original by default ... }
protected override IHalHttpClient Decorate(IHalHttpClient original, T context) { return(OnDecorate != null ? OnDecorate(original, context) : base.Decorate(original, context)); }
protected virtual IHalHttpClient Decorate(IHalHttpClient original) { return original; // return original by default ... }
protected abstract IHalHttpClient Decorate(IHalHttpClient original, T context);