예제 #1
0
        public void Run_BI_StoredProcedures()
        {
            //Arrange
            BIDataBase biDataBase = new BIDataBase()
            {
                StoredProcedures = new StoredProcedures()
                {
                    SP1 = "Test_StoredProcedure",
                    SP2 = "Test_StoredProcedure",
                    SP3 = "Test_StoredProcedure",
                    SP4 = "Test_StoredProcedure",
                    SP5 = "Test_StoredProcedure",
                    SP6 = "Test_StoredProcedure",
                    SP7 = "Test_StoredProcedure",
                    SP8 = "Test_StoredProcedure",
                    SP9 = "Test_StoredProcedure"
                },
                ConnectionString = "Test_ConnectionString"
            };

            var runBIStoredProceduresService = new RunBIStoredProceduresService();

            //Assert
            Should.Throw <ArgumentException>(() => runBIStoredProceduresService.RunBIStoredProcedures(biDataBase));
        }
예제 #2
0
 public IActionResult RunBIStoredProcedures()
 {
     try
     {
         var biConfiguration = new BIDataBase();
         Configuration.GetSection("BIDataBase").Bind(biConfiguration);
         var res = RunBIStoredProceduresService.RunBIStoredProcedures(biConfiguration);
         return(Ok());
     }
     catch (Exception ex)
     {
         Logger.Error(ex, ex.Message);
         return(BadRequest(ex));
     }
 }
예제 #3
0
        public async Task <bool> RunBIStoredProcedures(BIDataBase biDataBase)
        {
            try
            {
                Task procedureOne   = ExecuteStoredProceduresNonQuery(biDataBase.StoredProcedures.SP1, biDataBase.ConnectionString);
                Task procedureTwo   = ExecuteStoredProceduresNonQuery(biDataBase.StoredProcedures.SP2, biDataBase.ConnectionString);
                Task procedureThree = ExecuteStoredProceduresNonQuery(biDataBase.StoredProcedures.SP3, biDataBase.ConnectionString);
                Task procedureFour  = ExecuteStoredProceduresNonQuery(biDataBase.StoredProcedures.SP4, biDataBase.ConnectionString);
                Task procedureFive  = ExecuteStoredProceduresNonQuery(biDataBase.StoredProcedures.SP5, biDataBase.ConnectionString);
                Task procedureSix   = ExecuteStoredProceduresNonQuery(biDataBase.StoredProcedures.SP6, biDataBase.ConnectionString);
                Task procedureSeven = ExecuteStoredProceduresNonQuery(biDataBase.StoredProcedures.SP7, biDataBase.ConnectionString);
                Task procedureEight = ExecuteStoredProceduresNonQuery(biDataBase.StoredProcedures.SP8, biDataBase.ConnectionString);
                Task procedureNine  = ExecuteStoredProceduresNonQuery(biDataBase.StoredProcedures.SP9, biDataBase.ConnectionString);

                await Task.WhenAll(procedureOne, procedureTwo, procedureThree, procedureFour, procedureFive, procedureSix, procedureSeven, procedureEight, procedureNine);

                return(true);
            }
            catch (Exception ex)
            {
                Log.Error($"Error during the execution of BI stored procedures: {ex.Message}");
                throw ex;
            }
        }
 public RunBIStoredProceduresJob(IRunBIStoredProceduresService runBIStoredProceduresService, IOptions <BIDataBase> biDataBase)
 {
     RunBIStoredProceduresService = runBIStoredProceduresService;
     BIDataBase = biDataBase.Value;
 }