I have a simple edmx with two tables. Tables are linked by one Navigation Property . (1 to many).
When I run my code, I get the Exception: "Invalid dbo.Enquiries object name"
There is no dbo.Enquiries in the dbo.Enquiries (actually called dbo.Enquiry ), so the error itself explains it. But where does he find this name and how to fix it?
Edited to display code on request.
var foo = (from d in context.Dealerships join e in context.Enquiry on d.Id equals e.DealershipId where (d.ParentBusinessId == id) select d).AsEnumerable();
Here is the sql created.
foo {SELECT [Extent1].[Id] AS [Id], [Extent1].[BusinessName] AS [BusinessName] FROM [dbo].[Dealerships] AS [Extent1] INNER JOIN [dbo].[Enquiries] AS [Extent2] ON [Extent1].[Id] = [Extent2].[DealershipId] WHERE [Extent1].[ParentBusinessId] = @p__linq__0}
But for life, I canβt see where / how he decides to change the name. Request for internal join requests.
source share