Example #1
0
        public static async Task <IActionResult> Run([HttpTrigger(AuthorizationLevel.Admin, "post", Route = null)] HttpRequest req, ILogger log, ExecutionContext context)
        {
            log.LogInformation("CreateBlogEntry processed a request.");

            var completeArticle = AppConfigSettings.IngestRequest <CompleteClientArticle>(req, context);
            var articleInput    = AppConfigSettings.IngestRequest <CompleteClientArticle>(req, context);
            var mOpts           = AppConfigSettings.GetOptions();

            var bas     = new BlogArticleService(new CloudStorageContext(mOpts.StorageAccount), mOpts, log);
            var article = await bas.Add(completeArticle);

            return(new OkObjectResult(article));
        }
Example #2
0
        public static async Task <IActionResult> Run([HttpTrigger(AuthorizationLevel.Function, "get", Route = null)] HttpRequest req, ILogger log, ExecutionContext context)
        {
            log.LogInformation("GetArticleHeaders function processed a request.");

            var headersQuery = AppConfigSettings.IngestRequest <GetArticleHeadersInput>(req, context);
            List <IArticleDetails> results = new List <IArticleDetails>();
            var articleInput = AppConfigSettings.IngestRequest <CompleteClientArticle>(req, context);
            var mOpts        = AppConfigSettings.GetOptions();

            var bas = new BlogArticleService(new CloudStorageContext(mOpts.StorageAccount), mOpts, log);

            results.AddRange(await bas.FindArticlDetails(headersQuery.Start, headersQuery.End, headersQuery.Take, headersQuery.Skip));
            return(new OkObjectResult(results));
        }