-1

I have a problem with this query, I need to get all the results of the master tables mod_solicitud (x), ren_solicitud (y), these tables are related to other tables but not all records of the master tables exist in the related tables, so the applying an inner join, some data is lost, how can I apply a left join in linq to obtain these data or some other technique that allows to obtain all data tables?

example:

master tables:
table x,
table y

table a,
table b
var resultado =
    ((from x in "table x"
        join a in "table a" on a.id equals x.id
        select new
        {
            a.id,
            a.name,
            x.pp
        }).union(from y in "table y"
                join b in "table b" on b.id equals y.id
                select new
                {
                    b.id,
                    b.name,
                    x.ww
                })
    );
gunr2171
  • 16,104
  • 25
  • 61
  • 88
s_sanchez
  • 25
  • 4

1 Answers1

0

Left Outer Join sample.

var sample= (from e in table1
             join d in table2 on e.column equals d.column into ej
             from d in ej.DefaultIfEmpty()
             select new {e.column , e.column , d.column });
André Mendonça
  • 658
  • 8
  • 13