c# - Joining Two Tables but need to change value of Join -


i need join 3 tables. let's call them a, b , c.

ideally need join b c.

a contains id. b contains aid. easy join.

however, c has column looks "00901". match table b's aid "9".

mind you, aid int while "00901" varchar.

searchresults = db.a     .join(db.b, => a.id, b => b.aid, (a, b) => new { = a, b = b })     .join(db.c, b => b.b.aid, c => int32.parse(c.cid.substring(0, 3).trimstart('0')), (b, c) => new { b = b, c = c })     .select(c => c. ).distinct(); //this line not complete 

thoughts how can this?

we decided add column table make life easier everyone. question no longer needed. help.


Comments