Hi I have a Linq CodeBehind Function Like this
var result = from m in context.Products.Include(n=>n.Categories)
where m.IsActive == true
select m;
The m is Product Class which holds the list of categories.
On the ASPX page in repeater I want to have acces to first category where my product is. I tried tu use code like:
<a class="more" href="medication_details.aspx?id=<%# Eval("Categories.ID") %>>
The #Eval throws an error that Categories does not hold the property ID, and I think it's because products and categories are in relation one to many. how can I make in the aspx page reference like Categories[0].ID or sommthing??