I am using Entity Framework 6 with Code First, and I have a table with the following structure:
public class Item
{
[Key]
public int ItemId { get; set; }
[Required]
[MaxLength(255)]
public string Name { get; set; }}
public Item Parent { get; set; }
public virtual List<Item> Children { get; set; }
}
I would like to know if it's possible to get on a single query/trip to database, all Items
across my tree until the root, supplying a itemId
as argument.
e.g Give me all parents from ItemId
55 until no parent is found.