You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to ravendb
Is it possible to have something like:
var query = session.Query<Thing>().Where(...);
var defaultDate = DateTime.UtcNow.AddDays(1);
query.OrderBy(x => x.Date.HasValue ? x.Date : defaultDate);
?
When executing, I get an exception:
Unable to cast object of type
'System.Linq.Expressions.FullConditionalExpression' to type
'System.Linq.Expressions.MemberExpression'
Is this a limitation of the linq api or the underlying system?
Can someone suggest an alternative approach please?
Rob Ashton
unread,
Dec 4, 2010, 1:28:21 PM12/4/10
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to ravendb
That would be quite challenging I think, unless we had *specific*
handling for this particular scenario (a hack)
Ayende Rahien
unread,
Dec 4, 2010, 1:44:13 PM12/4/10
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to ravendb
No, we can't handle that scenario.
Ayende Rahien
unread,
Dec 4, 2010, 1:45:05 PM12/4/10
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to ravendb
RavenDB doesn't allow any sort of computation in the indexing stage.
What you can do is emit the Date field in the index with whatever logic you have in it, which will allow you to get the same result.
Andrew Davey
unread,
Dec 4, 2010, 6:28:23 PM12/4/10
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to ravendb
How about adding support for null coalescing? e.g. detect calls to
Nullable<T>.GetValueOrDefault(someVar)
That would work for my use case.
Andrew Davey
unread,
Dec 4, 2010, 6:35:06 PM12/4/10
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to ravendb
I'm not very familiar with creating more complex indexes (I've been so
happy with the dynamic index magic!)
Could you give a brief example of what I need to do? Should I use an
AbstractIndexCreationTask<T> to do it?