public static IActionResult GetCardtById( [HttpTrigger(AuthorizationLevel.Function, "get", Route = "{projectId}/cards/{id}")] HttpRequest req, [Table("cards", "{projectId}", "{id}", Connection = "AzureWebJobsStorage")] ResearchCardTableEntity researchCardTable, ILogger log, string id, string projectId) { log.LogInformation("Getting research card by id"); if (researchCardTable == null) { log.LogInformation($"Item {id} not found"); return(new NotFoundResult()); } return(new OkObjectResult(researchCardTable.ToResearchCard())); }
public static ResearchCard ToResearchCard(this ResearchCardTableEntity researchCard) { return(new ResearchCard { Id = researchCard.RowKey, ProjectId = researchCard.PartitionKey, CreatedTime = researchCard.CreatedTime, Source = researchCard.Source, Quote = researchCard.Quote, Summary = researchCard.Summary, Commentary = researchCard.Commentary, Keywords = researchCard.Keywords }); }