w*s 发帖数: 7227 | 1 right now my query in c# looks like this,
Table1Entry bMfi = MyDB.Table1.Single(x => x.Name == "abc");
Table1 is like this {Name, field1, field2}.
now i break Table1 into 2 tables,
Table0 has {id, Name};
Table1 has {id, field1, field2}.
What's the easiest way to do a query based on Name now ? | p*a 发帖数: 592 | 2 from t0 in Table0
join t1 in Table1
on t0.id == t1.id
where
t0.Name == "abc"
select
new {t0.id, t1.field1, t1.field2};
【在 w*s 的大作中提到】 : right now my query in c# looks like this, : Table1Entry bMfi = MyDB.Table1.Single(x => x.Name == "abc"); : Table1 is like this {Name, field1, field2}. : now i break Table1 into 2 tables, : Table0 has {id, Name}; : Table1 has {id, field1, field2}. : What's the easiest way to do a query based on Name now ?
| w*s 发帖数: 7227 | 3 cool, thanks !
【在 p*a 的大作中提到】 : from t0 in Table0 : join t1 in Table1 : on t0.id == t1.id : where : t0.Name == "abc" : select : new {t0.id, t1.field1, t1.field2};
|
|