Geeksltd / Olive

Olive framework, for more productive cross platform .NET solutions. It's available under the GPL v3 license. See License.md for more information.
https://geeksltd.github.io/Olive
Other
44 stars 44 forks source link

malformed sql when using IDatabaseQuery .WhereIn method #289

Closed hwduncan closed 3 years ago

hwduncan commented 4 years ago

when using the .WhereIn method on a IDatabaseQuery the generated sql statement is malformed and as such returns an error an example :

.WhereIn(timeIssue => timeIssue.User, Database.Of().Where(x => !x.Manager.DateArchived.HasValue || x.Manager.DateArchived > LocalTime.Now)

would generates

SELECT [.Manager_SystemUsers].ID FROM SystemUsers AS [.Manager_SystemUsers] WHERE [.Manager_SystemUsers].[ID] = [Teams].[Manager] AND Subqa177c3[.Manager_SystemUsers].[DateArchived] IS NULL) OR EXISTS ( SELECT [.Manager_SystemUsers].ID FROM SystemUsers AS [.Manager_SystemUsers] WHERE [.Manager_SystemUsers].[ID] = [Teams].[Manager] AND Subqa177c3[.Manager_SystemUsers].[DateArchived] > @Subqa177c3_Manager_SystemUsers_DateArchived))

also at the end of the query the paremeters: section would also show up as having incorrect syntax

stale[bot] commented 3 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.