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 GetTodoById( [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 item with Id {id}"); if (todo == null) { return(new NotFoundResult()); } return(new OkObjectResult(todo.ToTodo())); }