Q:

How can I implement SQL statement to LINQ in MVC?

Good day
I need to interpret the following SQL to LINQ.
select 
      t1.req_no,
      t1.seq_no,
      t1.quantity,
      t1.uom,
      t1.item_name,
      t2.event_date 
from tb_cs_test t1, tb_cs_test2 t2 where (t1.req_no = 1 and t2.req_no = 1 );

I use MVC and with this SQL Statement i need to throw the requested fields based on the condition that I put
Thanks

A:

You can do that with a JOIN:
from t1 in tb_cs_test 
join t2 in tb_cs_test2 
on t1.req_no equals t2.req_no
where t1.req_no = 1
select new {
  t1.req_no,
  t1.seq_no,
  t1.quantity,
  t1.uom,
  t1.item_name,
  t2.event_date 
}

