Exemplo n.º 1
0
 public static Todo ToTodo(this TodoTableEntity todo)
 {
     return(new Todo()
     {
         Id = todo.RowKey,
         CreatedTime = todo.CreatedTime,
         IsCompleted = todo.IsCompleted,
         TaskDescription = todo.TaskDescription
     });
 }
Exemplo n.º 2
0
 public static IActionResult GetTodoById(
     [HttpTrigger(AuthorizationLevel.Anonymous, "get", Route = route + "/{id}")] HttpRequest req,
     [Table("todos", "TODO", "{id}", Connection = "AzureWebJobsStorage")] TodoTableEntity todo,
     TraceWriter log, string id)
 {
     log.Info("Getting todo item by id");
     if (todo == null)
     {
         log.Info($"Item {id} not found");
         return(new NotFoundResult());
     }
     return(new OkObjectResult(todo.ToTodo()));
 }