Example #1
0
 public static Todo ToTodo(this TodoTableEntity todo)
 {
     return(new Todo()
     {
         Id = todo.RowKey,
         CreatedTime = todo.CreatedTime,
         TaskDescription = todo.TaskDescription,
         IsCompleted = todo.IsCompleted
     });
 }
Example #2
0
        public static IActionResult GetToDo(
            [HttpTrigger(AuthorizationLevel.Anonymous, "get", Route = "todo/{id}")] HttpRequest req,
            [Table("todos", "TODO", "{id}", Connection = "AzureWebJobsStorage")] TodoTableEntity todo,
            ILogger log, string id)
        {
            log.LogInformation("Getting todo list item " + id);

            if (todo == null)
            {
                log.LogInformation($"Item {id} not found");
                return(new NotFoundResult());
            }

            return(new OkObjectResult(todo.ToTodo()));
        }