entity framework - Convert SQL query into linq to entities -


i need converting sql query linq entities query. so, in project use entity framework , i've created dbcontext based on existing database. sample db structure below:

table 'a' - id, - name, - id_c - relationship between 'c' , 'a'.

table 'b' - id, - name.

table 'a_b' - many-to-many relationship between 'a' , 'b' - id_a, - id_b.

table 'c' - id, - name.

table 'b_c' - many-to-many relationship between 'b' , 'c' - id_b, - id_c.

table 'd' - id, - name - id_a - relationship between 'a' , 'e'.

table 'e' - id, - name - id_d - relationship between 'd' , 'e'.

and below sql query use retrieve data table 'e':

select _e.* e _e, d _d, _a inner join a_b _a_b on _a_b.id_b = 4 , _a_b.id_a = a.id left outer join b_c _b_c on _b_c.id_b = 4 , a.id_c = _b_c.id_c _e.id_d = _d.id , _d.id_a = _a.id 

i hope above query clear :) unfortunately can't same result when i'm using linq entities. when data model created, ef converted relationships entitycollection objects i'm not able make comparison: _a_b.id_a = a.id, because there no a_b table :/ know don't know ef , linq entities well, , need this. me creating replacement sql, please?


Comments

Popular posts from this blog

php - Calling a template part from a post -

Firefox SVG shape not printing when it has stroke -

How to mention the localhost in android -