g n

g n

  • NA
  • 10
  • 1.1k

What is the best practice to retrive from multiple tables ?

Mar 18 2017 8:56 PM
I have the following 3 tables structured in the way as shown below. I am new to entity framework and trying to figure the best way in terms of performance to retrieve data?

My goal is to "Select joblink, usersubmitted, runstatus, submitted_time, changelist
orderby submitted time"
 
 can anyone provide guidance on how to do this?
<div>
lookahead_run (Table#1)
+-------------------+--------+----------------+-------------------+----------+
lookahead_run_id(PK)|joblink | usersubmitted |submitted_time |runstatus
+-------------------+--------+----------------+-------------------+----------+
15963---------------+link1---+---username1----+2017-03-17 22:28:53--Fail-----


lookahead_run_change_list (Table#2)
+---------------+----------------+-----------------+
changelistid(PK)|lookahead_run_id|change_list_id
+---------------+----------------+-----------------+
38591-----------+15963-----------+34022
38590-----------+15963-----------+34021
38589-----------+15963-----------+34020


change_lists (Table#3)
+-------------+-----------+
change_list_id|changelist
+-------------+-----------+
34022-------- 1823900
34021-------- 1819483
34020-------- 1818572
 
CODE:-
I have a holder class as below to send the output as an object to the client
namespace Dashboard.Model.ApiModels
{
public class LookaheadRunInfo
{
public string ECJobLink { get; set; }
public List<String> gerrits { get; set; }
public string UserSubmitted { get; set; }
public string SubmittedTime { get; set; }
public string RunStatus { get; set; }
}
}

</div>

Answers (3)