I'm trying to do something like:
Session.Query<VoiceMailNumber>()
.Where(x => (x.From.CompareTo(number) > 0) &&
(x.To.CompareTo(number)) > 0)
But that throws System.NotSupportedException.
From and number are both strings.
Any solution?
This solves it:
Session.CreateCriteria(typeof(VoiceMailNumber))
.Add(Expression.Le("From", number))
.Add(Expression.Ge("To", number))
.UniqueResult<VoiceMailNumber>();
I'm not super happy with this solution, but since it's not possible to compare strings using query or queryover, it will have to do.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With