Beispiel #1
0
        public async Task <IEnumerable <Dictionary <string, object> > > ExecuteSourceOperation(ActiveOperation ops)
        {
            // TODO
            // 1) Read file content from blob storage
            // 2> Return List from excel data

            var intermediateJson = JsonConvert.DeserializeObject <string>(ops.Content);
            var content          = JsonConvert.DeserializeObject <ExcelDocument>(intermediateJson);

            using (var da = new DocumentDataAccess(_conStr))
            {
                var doc = await da.Get(Convert.ToInt32(content.DocumentId));

                if (doc != null)
                {
                    var bs          = new BlobStorageService(blobContainer);
                    var blobContent = await bs.GetBlob(doc.WebUrl);

                    var excelData = new ExcelManager().ExtractData(blobContent);

                    return(excelData);
                }
            }

            return(null);
        }
Beispiel #2
0
        public static async Task <IActionResult> ConnectorGet(
            [HttpTrigger(AuthorizationLevel.Anonymous, "get", Route = "documents")] HttpRequest req,
            ILogger log)
        {
            using (var da = new DocumentDataAccess(conStr))
            {
                var result = await da.Get();

                return(new OkObjectResult(result.ToList().OrderByDescending(p => p.CreatedDate)));
            }
        }