What you have there should work however, what I think might be happening is due to these conditions happening:
- You have a column
TableBId
onTableA
- You don't have a
TableBId
property on the classTableA
- When you run the query manually, City is coming after
TableBId
on theTableA.*
part
The mapping works by running through the columns in order and the processing works by:
- If the column in on the first class in your generic parameter list it will get mapped and move on to the next column (still using the first class for mapping)
- If the column is not on the first class, then it will consider the first class finished and move to the second class and so on....