DelegateDecompiler icon indicating copy to clipboard operation
DelegateDecompiler copied to clipboard

DbArithmeticExpression

Open dmostert opened this issue 8 years ago • 0 comments

This is another attempt at DateDiff:

[Computed] public int Days => ((DateTime?) DateTime.Today - (DateTime?) LoggedDate)?.Days ?? 0;

This version works better than the DateDiff version, but I sometimes get the following exception:

DbArithmeticExpression arguments must have a numeric common type.

This seems to happen when Days is used in a Where or OrderBy clause.

Any suggestions?

dmostert avatar Mar 17 '17 06:03 dmostert