C # Lambda with 2 tables

1

I have the statement below, in C #, and would like to include an existing information in another table, such as the apartment column (existing in the condomino table).

return GetUltraGeneric<Usuario>().Where(p => p.condominio == Constants.codigo_condominio).ToList();

Am I on the right track? I tried .Join (), GroupJoin () and I do not know how.

Thank you!

    
asked by anonymous 03.06.2018 / 03:38

1 answer

0

Through your description would be more or less this here friend:

GetUltraGeneric<Usuario>().Join(GetUltraGeneric<Condominio>(),
                                usuario => usuario.condominio,
                                condominio => condominio.cod_condominio,
                                (usuario, condominio) => new
                                {
                                    Usuario = usuario, 
                                    Condominio = condominio
                                })
                          .Where(p => p.condominio == Constants.codigo_condominio)
                          .ToList();
    
26.06.2018 / 04:45