public static Todo To(this TodoTableEntity todo) { return(new Todo() { Id = todo.RowKey, CreatedTime = todo.CreatedTime, IsCompleted = todo.IsCompleted, TaskDescription = todo.TaskDescription }); }
public static IActionResult GetTodoById( [HttpTrigger(AuthorizationLevel.Function, "get", Route = RouteIdUrl)] HttpRequest req, [Table(TableName, PartitionKey, "{id}", Connection = StorageConnectionStr)] TodoTableEntity todo, ILogger log, string id) { log.LogInformation("Getting todo item by id"); if (todo == null) { log.LogInformation($"todo [{id}] not found."); return(new NotFoundResult()); } return(new ObjectResult(todo.To())); }