Beispiel #1
0
 public static Todo ToTodo(TodoTableEntity todoRow)
 {
     return(new Todo()
     {
         Id = todoRow.RowKey,
         Created = todoRow.Created,
         Description = todoRow.Description,
         IsCompleted = todoRow.IsCompleted
     });
 }
Beispiel #2
0
 public static IActionResult GetTodoById(
     [HttpTrigger(AuthorizationLevel.Anonymous, "get", Route = "todo/{id}")] HttpRequest req,
     [Table("todos", "Todo", "{id}", Connection = "AzureWebJobsStorage")] TodoTableEntity todoItem,
     ILogger log, string id)
 {
     log.LogInformation("Get todo list item by id.");
     if (todoItem == null)
     {
         return(new NotFoundResult());
     }
     return(new OkObjectResult(Mapper.ToTodo(todoItem)));
 }