IRepositories Join in Subsonic

142 Views Asked by At

Hi i'm stuck with this doubt:
How do I make i Join with 2 IRepositories? look my controller...

public ActionResult Colaboradores(int baseid)
    {

        IRepository<Colaborador> _repocolab = new SubSonicRepository<Colaborador>();
        IRepository<Usuario> _repouser = new SubSonicRepository<Usuario>();




        return View();
    }

I need to join these IRepositories to get "Ativo" from Colaborador and "Nome" from Usuario making a Where in Colaborador with baseid parameter...

How can i do that??? Please :)

1

There are 1 best solutions below

1
lomaxx On

Unfortunately the repository pattern isn't going to provide you with the ability to query across two repositories.

One method which you might be able to use is to create a view in the database which contains all the properties you need and then get subsonic to create a class that reflects this view for you.