Hi, I have the following Linq query in which i am joining two tables using multiple fields but it gives me error that "The Type of the expression in Join Claus is incorrect. Type inferences fails in the call to group join":
C#
var depAirportCode = from b in dbContext.Bookingsjoin f in dbContext.Flights on new{Key1 = b.FlightInfoId,Key2 = b.OperatingAirlineCode,Key3 = b.RequestedFlightNumber}equals new{Key1 = f.FlightInfoId,Key2 = f.OperatingAirlineCode,Key3 = $"{f.OperatingAirlineCode}{f.OperatingFlightNumber}"}into result where b.BookingReference == "AP15-1464"
select b.DepartureAirportCode;

Jignesh KumarRank #91 · 22.9K reputationPosted Sep 22, 2021, 1:27 AM EDT
Basem AlshabaniRank #3,323 · 432 reputationPosted Sep 20, 2021, 4:03 PM EDT
From arecord in a join brecord in b On new{arecord.id,arecord.name}equals new {brecord.id,brecord.name}