I have a simple requirement if done via sql query. I have table A which is category with ID,Name table b which is categoryItems which has foreign key of A CategoryId,Name. I am using linqdatasource with simple select statements to show data from table A.
select * from A (simple)
I have a requirement now where i want to "not show" categories in first place who do not have any items associated with them i. e (select count(*) from B where CategoryId="")>0
Very easy by modifying sql statement, was wondering if it can be done by possible accessing foreign key relationship data using any out of box linq functionality and applying the validation.
Just keen on it!..
Thanks a ton!