c# - What is the right and efficient way to retrieve data using Entity Framework 6 -


i have 2 tables:

t1 {   columns: **a**, b, c }  t2 {   columns: d, e, f, **a** } 

t1 has 1 many connection t2 using foreign key (column a).

i'm trying retrieve list of f in case a=1,b=2,e=3.

what right , efficient way retrieve data?

  • is join statement?
  • is retrieving t1 (where a=1,b=2) including t2 , looping on result (and eliminate irrelevant t2)?
  • some other way?

var lst = (from t1 in context.t1         join t2 in context.t2 on t1.a equals t2.a         t1.a == 1 && t1.b == 2 && t2.e == 3         select t2.f).tolist(); 
  • join tables
  • filter in clause
  • select 1 property interested in

Comments

Popular posts from this blog

asynchronous - C# WinSCP .NET assembly: How to upload multiple files asynchronously -

aws api gateway - SerializationException in posting new Records via Dynamodb Proxy Service in API -

asp.net - Problems sending emails from forum -