public static Todo ToTodo(TodoTableEntity todoRow) { return(new Todo() { Id = todoRow.RowKey, Created = todoRow.Created, Description = todoRow.Description, IsCompleted = todoRow.IsCompleted }); }
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))); }