예제 #1
0
        public async Task <ActionResult <string> > ExecuteRule(DataQCParameters qcParams)
        {
            string result = "[]";

            try
            {
                if (qcParams == null)
                {
                    return(BadRequest());
                }
                string     tmpConnString = Request.Headers["AzureStorageConnection"];
                DataQC     qc            = new DataQC(tmpConnString);
                List <int> failedObjects = new List <int>();
                failedObjects = await qc.ExecuteQcRule(qcParams);

                RuleFailures ruleFailures = new RuleFailures()
                {
                    RuleId = qcParams.RuleId, Failures = failedObjects
                };
                result = JsonConvert.SerializeObject(ruleFailures);
            }
            catch (Exception ex)
            {
                return(BadRequest(ex.ToString()));
            }

            return(result);
        }
예제 #2
0
        public static async Task <List <int> > DataQC([ActivityTrigger] DataOpParameters pipe, ILogger log)
        {
            List <int> result = new List <int>();

            try
            {
                log.LogInformation($"DataQC: Starting");
                DataQC           qc      = new DataQC(pipe.StorageAccount);
                DataQCParameters qcParms = JObject.Parse(pipe.JsonParameters).ToObject <DataQCParameters>();
                result = await qc.ExecuteQcRule(qcParms);

                log.LogInformation($"DataQC: completed rule id {qcParms.RuleId} with result = {result}");
            }
            catch (Exception ex)
            {
                log.LogInformation($"InitDataQC:Serious exception {ex}");
            }

            return(result);
        }