Hi,
Appreciate if I can get some help writing a LINQ that will get ALL FIELDS from table A, and those fields for which profile 1 has a value in table AB, show the value, otherwise if profile 1 has no entry in table AB, then show value as null.
Table A
AID Field
-----------
1 OneField
2 TwoField
3 ThreeField
Table B
BID Value
-----------
1 OneValue
2 TwoValue
3 ThreeValue
Table AB
ABID AID BID ProfileId
-------------------------
1 1 1 1
2 2 3 1
I'm trying to write a Linq (or sql query) that will show me for profile id 1, all the values from table a, and for those that apply, the value from table b.
e.g.
ProfileID AID Field BID Value
--------------------------------------------------------
1 1 OneField 1 OneValue
1 2 TwoField 3 ThreeValue
1 3 ThreeField NULL NULL
As you can see, the aim is to get ALL FIELDS from table A, and those fields for which profile 1 has an entry in table AB, show the value from table B, otherwise if profile 1 has no entry in table AB, then show as null.
If the solution requires it, I am happy to write that in sql and call it via stored proc.
Thanks