[CSHARP-2008] Member in projection cannot be translated. Created: 26/Jun/17 Updated: 26/Nov/18 Resolved: 26/Nov/18 |
|
| Status: | Closed |
| Project: | C# Driver |
| Component/s: | Linq |
| Affects Version/s: | 2.4.3 |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Minor - P4 |
| Reporter: | Koen Vanoverloop | Assignee: | Robert Stam |
| Resolution: | Done | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Environment: |
Windows 10, VS 2017, netcoreapp1.1 |
||
| Description |
|
I receive an System.NotSupportedException on the mongo driver when querying a collection: Abstract: "Member [xxx] of type [xxx] in the expression tree [xxx] cannot be translated." It seems there is a bug in converting the expression tree.
it works when I don't use the variable: without expression variable, it also works: query.Select(c => new CarrierSummary ); |
| Comments |
| Comment by Robert Stam [ 23/Oct/18 ] | |
|
I am trying to reproduce this but there is not enough information to compile without errors and test it. There are a number of types that I don't have definitions for (although I can guess at them). And the following line does not compile
because the carrierContracts argument to GroupJoin does not implement IEnumerable<T>. Can you provide a sample that can actually be compiled and run? | |
| Comment by Koen Vanoverloop [ 07/Jul/17 ] | |
|
We do have a workaround for the moment, but it is not optimal. So, if you can take a look in why the local variables don't translate well, It should be be nice. Thanks, Koen | |
| Comment by Craig Wilson [ 05/Jul/17 ] | |
|
Hi Koen, On the surface, this appears odd to me. I don't see anything weird about your code, so this is probably a bug inside our code related to expanding captured variables. Do have a workaround at this point? Craig |