Beispiel #1
0
 public static Project ToProject(this ProjectTableEntity project)
 {
     return(new Project
     {
         Id = project.RowKey,
         CreatedTime = project.CreatedTime,
         Name = project.Name
     });
 }
Beispiel #2
0
 public static IActionResult GetProjectById(
     [HttpTrigger(AuthorizationLevel.Function, "get", Route = "projects/{id}")] HttpRequest req,
     [Table("projects", "PROJECT", "{id}", Connection = "AzureWebJobsStorage")] ProjectTableEntity todo,
     ILogger log, string id)
 {
     log.LogInformation("Getting project item by id");
     if (todo == null)
     {
         log.LogInformation($"Item {id} not found");
         return(new NotFoundResult());
     }
     return(new OkObjectResult(todo.ToProject()));
 }