I want to join two tables. The joining columns are column3, column4 for both the tables.
Visual Studio is throwing the following error:
The type arguments for method
'System.Linq.Enumerable.Join (System.Collections.Generic.IEnumerable, System.Collections.Generic.IEnumerable, System.Func, System.Func, System.Func)'
cannot be inferred from the usage. Try specifying the type arguments explicitly.
My code is as follows:
int i = context.Table1.Where(u => u.column1 == true).Join(
context.Table2.Where(u => u.column2.ToUpper() == "COMPLETED"),
q => new { Column3 = q.column3, Column4 = q.column4 },
u => new { Column3 = u.column3, Column4 = u.column4 },
(q, u) => new { q.column1 }).Count();
What is wrong with this query?
Thanks in advance.