SortExpression & EntityField2

Posts   
 
    
simon831
User
Posts: 152
Joined: 19-Jan-2006
# Posted on: 19-Jan-2006 18:53:02   

SortExpression sorter = (HelperClasses.DocumentFields.CreatedDate | SortOperator.Descending);

Following the documentation I expected this to be simple, but CreatedDate is of type EntityField2 and so an exception is thrown trying to convert it to SortExpression.

What am I missing?

bclubb
User
Posts: 934
Joined: 12-Feb-2004
# Posted on: 20-Jan-2006 02:42:09   

Try this instead. I get the same error you do so it may just be an error in the docs. SortExpression sorter = new SortExpression(SortClauseFactory.Create(DocumentFieldIndex.CreatedDate, SortOperator.Descending));