I'm trying to apply a conditional SortBy to a find as follows:
var findFluent = Collection.Find (...)
.SortBy (record => record.IsActive)
.SortBy (record => record.Client != null
? record.Client.Profile.FirstName
: record.Profile.FirstName);
However, I'm receiving the following error:
"Unable to determine the serialization information for record => IIF((record.Client != null), record.Client.Profile.FirstName, record.Profile.FirstName)."
Do I have to add/implement IBsonDocumentSerializer on one of the classes in question or is this operation not possible?