Hello all.
Me again with a dumb question/scenario I need advice on.
I have the following that pulls back the contents of a column:
return getappropriateuserfield.tblAutoComplete
.Where(p => p.MemberId == memberid && p.ACItem == acitem)
.Select(p => p.ACColumn)
.Distinct()
.ToArray();
Depending upon this result, I'd like to then take the ACColumn result, go to tblPreferences, look down ColumnName, and if it matches an entry in there, pull back the Alias (present in tblPreferences)
So, for example we have tblAutoComplete:
MemberID ACItem ACColumn
1 2 UUF1
tblPreferences looks like
MemberID ColumnName Alias
1 UUF1 Category
If the user sticks in "2" as the ACItem, the first part result would be "UUF1" - the linq above does this.
How do I alter the linq so that the second part takes place, ie. takes the UUF1, looks in tblPreferences, checks out ColumnName, sees the result matches so the final result is the Alias, "Category"
Do I need to do this in 2 parts or can I do it as one query, potentially using a join?
Apologies for the thickness.