[CSHARP-632] Linq OrderBy throws when Expression type is object and property type is a value type Created: 20/Nov/12 Updated: 20/Mar/14 Resolved: 10/Dec/12 |
|
| Status: | Closed |
| Project: | C# Driver |
| Component/s: | None |
| Affects Version/s: | 1.6.1 |
| Fix Version/s: | 1.8 |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Tim Kellogg | Assignee: | Craig Wilson |
| Resolution: | Done | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||
| Description |
|
We were using the .OrderBy extension method with a custom Expression. The Mongo driver seems to strip out the `Convert(...)` that the C# compiler adds (to box value types to reference types). i.e. Expression<Func<TModel, DateTime>> sortExpression = m => m.UploadDate; Pull request is following, on Github. |
| Comments |
| Comment by auto [ 10/Dec/12 ] |
|
Author: {u'date': u'2012-12-10T16:04:34Z', u'email': u'craiggwilson@gmail.com', u'name': u'Craig Wilson'}Message: |
| Comment by auto [ 10/Dec/12 ] |
|
Author: {u'date': u'2012-12-10T16:04:34Z', u'email': u'craiggwilson@gmail.com', u'name': u'Craig Wilson'}Message: |
| Comment by Craig Wilson [ 10/Dec/12 ] |
|
In code review. |
| Comment by Tim Kellogg [ 20/Nov/12 ] |
|
Pull request is at https://github.com/mongodb/mongo-csharp-driver/pull/140 |