public static Todo ToTodo(this TodoTableEntity todo) { return(new Todo() { Id = todo.RowKey, CreatedTime = todo.CreatedTime, IsCompleted = todo.IsCompleted, TaskDescription = todo.TaskDescription }); }
public static IActionResult GetTodo( [HttpTrigger(AuthorizationLevel.Anonymous, "get", Route = "/api/todo/{id}")] HttpRequest request, [Table("todos", "TODO", "{id}", Connection = "AzureWebJobsStorage")] TodoTableEntity todo, ILogger logger, string id ) { logger.LogInformation("Getting ToDo Item"); if (todo != null) { return(new OkObjectResult(todo.ToTodo())); } logger.LogInformation($"Item {id} not found"); return(new NotFoundResult()); }