예제 #1
0
        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);
        }
예제 #2
0
        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);
        }
예제 #3
0
 public ApiContext(string url)
 {
     this.key = url;
     this.apiSourceContext = GetContext();
 }