Kros-sk / Kros.KORM

Simple and fast micro-ORM framework for .NET.
MIT License
9 stars 16 forks source link

Fix ORDER BY nullable column in OData query #92

Closed satano closed 2 years ago

satano commented 2 years ago

Fixes #90

We use ODataQueryOptions<TEntity>.ApplyTo .NET method to apply OData query parameters to KORM query. If ORDER BY clause in OData query is using nullable field (column), the condition is generated this way: IIF(($item.Field == null), null, $item.Field). This cannot be used as ORDER BY for SQL query. When the value of FixOrderByNullableColumnInODataQuery is true, this case is fixed when generating SQL. Only $item.Field is used in SQL's ORDER BY.

update-docs[bot] commented 2 years ago

Thanks for opening this pull request! If you have implemented new functions, write about them in the readme file.