I am trying to make a left outer join
request that also has a custom comparator
.
I have the following lists:
List<ColumnInformation> list1; List<ColumnInformation> list2;
They contain information about the SQL column (data type, name, table, etc.). I overridden Equals
for the class and made operator ==
and operator !=
.
I understand how to make a left outer join :
var leftOuterJoin = from l1 in list1 join l2 in list2 on l1.objectID equals l2.objectID into temp from l2 in temp.DefaultIfEmpty(new { l1.ID, Name = default(string) }) select new { l1.ID, ColumnName1 = l1.Name, ColumnName2 = l2.Name, };
And I understand how to create and use a custom IEqualityComparer
:
public class ColumnComparer : IEqualityComparer<ColumnInformation> { public bool Equals(ColumnInformation x, ColumnInformation y) { return x == y;
My question is: How can I make both a left outer join and use my comparator at the same time ?
As far as I know, the query syntax does not have a keyword for the comparator, and the extension method has nothing for the into
keyword.
I don't care if the result is in the query syntax or extension methods.
source share