public ApiSourceContext GetContext() { ApiSourceContext sourceContext = new ApiSourceContext(); sourceContext.Uri = ConfigurationManager.AppSettings[key]; sourceContext.Uri = sourceContext.Uri != null?sourceContext.Uri.TrimEnd(new char[] { '/', '\\' }) : null; return(sourceContext); }
public ApiSourceContext GetContext() { ApiSourceContext sourceContext = new ApiSourceContext(); var builder = new ConfigurationBuilder().AddJsonFile("appsettings.json"); IConfigurationRoot Configuration = builder.Build(); sourceContext.Uri = Configuration[key]; sourceContext.Uri = sourceContext.Uri != null?sourceContext.Uri.TrimEnd(new char[] { '/', '\\' }) : null; return(sourceContext); }
public ApiContext(string url) { this.key = url; this.apiSourceContext = GetContext(); }