Hi
I have 2 tables that have a relation ship to each other
Table A has 1 to many relationship with table B
so this make a navigation property into each.
Now I need to check a value from Table A(userName) and I need to check a value from table B(ClubId).
So in my mind it would be something like
Join the tables together
Where A.userName == "bob" &&
where B.clubId == "Car"
// return the count.
but now I know with Entity stuff it should make joins less common so I am wondering if I can do it with a join then.
I tried this
int count = Entity.TableA.where(a => a.userName == "bob" && a.TableB.where(i => i.ClubId == "Car")).Count();
so this does not work since it won't return the right type(the 2nd where). This is just how I thought along the lines how I would expect it to be done would work.
So how should it look?
P.S
I rather have an example done in the Linq Method quieries like I did above.