I have created the query successfully for getting data from 6 tables via lambda expressions as well as other ways. (Sorry don't know what to call other methods I applied). Anyway, now the problem is, I don't know how to send this object to the View. In general I used to send the object of the model or ViewModel. Please help!

Thank you so much in advance!

I have tried creating ViewModel and included all objects included in the query but I am just unable to settle them down. May be its the wrong strategy or may I am just don't know how to do it.

```
var my = _context.Clients.Join(_context.Consultants, cli => cli.consultantID, con => con.ConsultantId,
            (cli, con) => new
            {
                aClient = cli,
                aConsultant = con
            }).Join(_context.ClientPhone.Where(ph => ph.PrimaryPhone), cli => cli.aClient.ClientCNIC, ph => ph.ClientCNIC, (cli, ph) => new
            {
                cli.aClient,
                cli.aConsultant,
                aPhone = ph
            }).Join(_context.clientemail.Where(e => e.PrimaryEmail), cli => cli.aClient.ClientCNIC, e => e.ClientCNIC, (cli, e) => new
            {
                cli.aClient,
                cli.aConsultant,
                cli.aPhone,
                aEmail = e
            }).Join(_context.ITRStatus, cli => cli.aClient.ClientCNIC, itr => itr.ClientCNIC, (cli, itr) => new
            {
                cli.aClient,
                cli.aConsultant,
                cli.aEmail,
                cli.aPhone,
                aItr = itr
            }).Join(_context.ClientStatus, cli => cli.aItr.ClientstatusId, ss => ss.clientstatusId, (cli, ss) => new
            {
                cli.aClient,
                cli.aConsultant,
                cli.aEmail,
                cli.aItr,
                cli.aPhone,
                aStatus = ss
            }).Select(s => new
            {
                s.aClient.clientName,
                s.aClient.ClientCNIC,
                s.aClient.ClientPassword,
                s.aConsultant.ConsultantName,
                s.aEmail.Email,
                s.aPhone.Phone,
                s.aStatus.StatusString
            }).ToList();

        return View(my);

```

What I expect the result to be, I somehow send the object to the View via Model and then Iterate the Model in the View using foreach.