示例#1
0
        private void BuildAppSettingsProvider(string enviropment)
        {
            CentralLog.LogInfo(String.Concat(":: Runing in :: ", enviropment));

            AppSettingsProvider.IsDevelopment = enviropment == "Development";
            AppSettingsProvider.Enviropment   = enviropment;
            AppSettingsProvider.NameAPIOne    = StaticConfig.GetSection("Settings").GetSection("API").GetSection("NameAPIOne").Value;
        }
示例#2
0
        private static string genralRequest(string EndpointTO, string ARGS, string transactionIDCancell = "")
        {
            if (EndPoints.debugMode)
            {
                CentralLog.LogInfo($"ENDPOINTS :: CALL {EndpointTO} with [{ARGS}]");
            }

            string url = EndpointTO;

            string parametros = "/" + ARGS;

            const string authHeaders  = "";
            const string postDataSend = "";

            if (EndPoints.debugMode)
            {
                CentralLog.LogInfo("ENDPOINTS :: JSON");
                CentralLog.LogInfo(postDataSend);
            }

            string returnStrng = "";

            try {
                string returnStr = RequestAPI.GetT(url, parametros, authHeaders);

                if (EndPoints.debugMode)
                {
                    CentralLog.LogInfo("ENDPOINT :: Return from API");
                    CentralLog.LogInfo(returnStr);
                }
                if (returnStr.Length > 0)
                {
                    var now = JsonParse.parseSWAPJSON(returnStr);


                    returnStrng = returnStr;
                }
            } catch (Exception e) {
                Dictionary <string, string> myResp = new Dictionary <string, string> ()
                {
                    { "status", "500" },
                    { "message", e.Message },
                    { "erroMessage", "imposibilitado de acessar API, tente novamente" },
                    { "erro", e.ToString(  ) }
                };

                returnStrng = JsonParse.genJson(myResp, new List <string>());

                CentralLog.LogError(e, ":: ENDPOINTS ERROR :: >> CANOT ACCESS TOKEN ::");
            }

            return(returnStrng);
        }
示例#3
0
 public Startup(IConfiguration configuration)
 {
     CentralLog.LogInfo("Begin Burn");
 }