Exemple #1
0
        public void ConfigureServices(IServiceCollection services)
        {
            var configurationFileApp = new ConfigurationFileApp();
            var httpUtilityTool      = new HttpUtilityTool();

            services.AddMvc().SetCompatibilityVersion(CompatibilityVersion.Version_2_2);

            services.AddSingleton <IBinanceProcessor>(
                new BinanceProcessor(new Uri(configurationFileApp.BinanceUrl), httpUtilityTool));
            services.AddSingleton <TickerRepository>(new TickerRepository(configurationFileApp.ConnectionString));
        }
Exemple #2
0
    public static string UrlEncode(string temp, Encoding encoding)
    {
        StringBuilder stringBuilder = new StringBuilder();

        for (int i = 0; i < temp.Length; i++)
        {
            string t = temp[i].ToString();
            string k = HttpUtilityTool.UrlEncode(t, encoding);
            if (t == k)
            {
                stringBuilder.Append(t);
            }
            else
            {
                stringBuilder.Append(k.ToUpper());
            }
        }
        return(stringBuilder.ToString());
    }