DelegateDecompiler
DelegateDecompiler copied to clipboard
DbArithmeticExpression
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?