score:1

Accepted answer
ilist<ticketlistmodel> ticketlist = (from t in db.tickets
                        join e in db.employees on t.id equals e.id
                        select new ticketlistmodel
                        {
                            number = t.number,
                            requestdate = t.requestdate,
                            applicant = e.name,
                            comname = comlibs.name,
                            probtype = t.probtype,
                            probdetail = t.probdetail,
                            status = t.status
                        }).tolist();

score:0

public actionresult index()
{
    ilist<ticketlistmodel> ticketlist = new list<ticketlistmodel>();
    var ticketlistquery = from t in db.tickets
                          from a in db.employees
                          where t.id == a.id
                          select new ticketlistmodel
                          {
                              t.number,
                              t.requestdate,
                              applicant = a.name,
                              comname = comlibs.name,
                              t.probtype,
                              t.probdetail,
                              t.status
                          };
    ticketlist = ticketlistquery.tolist();
    return view(ticketlist);
}

score:0

public actionresult index()
{
    ilist<ticketlistmodel> ticketlist = new list<ticketlistmodel>();
    var ticketlistquery = from t in db.tickets
                          select new ticketlistmodel
                          {
                              number = t.number,
                              requestdate = t.requestdate,
                              applicant = t.applicant.name,
                              comname = t.comlib.name,
                              probtype = t.probtype,
                              probdetail = t.probdetail,
                              status = t.status
                          };
    ticketlist = ticketlistquery.tolist();
    return view(ticketlist);
}

Related Query

More Query from same tag