[CSHARP-1268] SortBy exception with enum property type Created: 06/May/15  Updated: 06/May/15  Resolved: 06/May/15

Status: Closed
Project: C# Driver
Component/s: API
Affects Version/s: 2.0
Fix Version/s: None

Type: Bug Priority: Major - P3
Reporter: Cuong Vu Assignee: Unassigned
Resolution: Duplicate Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
is related to CSHARP-1228 Expressions used to resolve field nam... Closed

 Description   

return await this.Collection.Find(t => t.Name.Equals(name)) .SortBy(t => t.Gender).Project(projection).ToListAsync();

if Gender property is Enum type driver will throw exception "Unable to determine the serialization information for t => Convert(t.Gender)."



 Comments   
Comment by Craig Wilson [ 06/May/15 ]

Hi Cuong,

This was already reported in CSHARP-1228. It has been fixed and will be part of the next release. Until then, you should use a string with the Sort method instead.

Craig

Generated at Wed Feb 07 21:39:07 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.