NorthernLight1 / N.EntityFramework.Extensions

Bulk data support for the EntityFramework 6.5.0+
MIT License
35 stars 20 forks source link

Fix GetTableAlias with one-to-one relationship #102

Closed maftieu closed 1 year ago

maftieu commented 1 year ago

With a one-to-one relationship, updating the "dependant" entry with a criteria on the "parent" entity results in a WHERE clause like this one

FROM [dbo].[ChildEntity] AS [Extent1]     INNER JOIN [dbo].[ParentEntity] AS [Extent2] ON [Extent2].[Id] = [Extent1].[Id]

The SqlBuilder.GetTableAlias() function returns something like [Extent2] ON [Extent2].[Id] = [Extent1].[Id], which is wrong.

NorthernLight1 commented 1 year ago

I reviewed the code and it looks good.