There seems to be an issue with generated SQL if I use .Where with JSON_VALUE function
query.Where($"JSON_VALUE(PropertiesJson, '$.{filter.Key}')", filter.Value)
produces
SELECT * FROM [schema].[Table] WHERE [JSON_VALUE(PropertiesJson, '$].[slug')] = 'culture'
but it should produce this
SELECT * FROM [schema].[Table] WHERE JSON_VALUE(PropertiesJson, '$.slug') = 'culture'
I use the resulting sql to feed it to .FromSqlRaw() of EF Core and obviously if fails.
There seems to be an issue with generated SQL if I use .Where with JSON_VALUE function
query.Where($"JSON_VALUE(PropertiesJson, '$.{filter.Key}')", filter.Value)produces
SELECT * FROM [schema].[Table] WHERE [JSON_VALUE(PropertiesJson, '$].[slug')] = 'culture'but it should produce this
SELECT * FROM [schema].[Table] WHERE JSON_VALUE(PropertiesJson, '$.slug') = 'culture'I use the resulting sql to feed it to .FromSqlRaw() of EF Core and obviously if fails.