public static Blog BlogEntity(this BlogEntity blog)
 {
     return(new Blog()
     {
         BlogId = blog.RowKey,
         BlogCreatedDate = blog.BlogCreatedDate,
         BlogCategory = blog.BlogCategory,
         BlogSubject = blog.BlogSubject,
         BlogBody = blog.BlogBody,
         BlogModifiedDate = blog.BlogModifiedDate
     });
 }
Exemple #2
0
 public static IActionResult GetBlogPostsById(
     [HttpTrigger(AuthorizationLevel.Anonymous, "get", Route = "blog/{blogid}")] HttpRequest req,
     [Table("aramizblog", "blog", "{blogid}", Connection = "AzureWebJobsStorage")] BlogEntity blogTable,
     ILogger log, string blogid)
 {
     log.LogInformation("Getting aramiz blogpost by id");
     if (blogTable == null)
     {
         log.LogInformation($"BlogEntity {blogid} not found");
         return(new NotFoundResult());
     }
     return(new OkObjectResult(blogTable.BlogEntity()));
 }