You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Some types needs to be converted before being projected to a column in sql server. Say we have a property named Consumption of type Energy, which can be converted to kWh like:
x.Consumption.KWh
To project this while still having a reasonable name for the column we can override the name:
.With(nameof(Consumption), x => x.Consumption.KWh)
But then when querying this we can no longer just use x.Consumption, but have to use the .Column() extension method like:
from x in xs
where x.Column<decimal>(nameof(x.Consumption)) == 100
select x
We would like to be able to be able to write:
from x in xs
where x.Consumption == 100.KWh()
select x
To do that we have to know - in the linq provider - that the projection (on the left) has been converted and then apply the same conversion to the value (on the right) before building the sql. I think the config could look like this:
Some types needs to be converted before being projected to a column in sql server. Say we have a property named Consumption of type Energy, which can be converted to kWh like:
To project this while still having a reasonable name for the column we can override the name:
But then when querying this we can no longer just use x.Consumption, but have to use the .Column() extension method like:
We would like to be able to be able to write:
To do that we have to know - in the linq provider - that the projection (on the left) has been converted and then apply the same conversion to the value (on the right) before building the sql. I think the config could look like this:
This could maybe also be used to fix issue #30 .
The text was updated successfully, but these errors were encountered: