-
Type: Bug
-
Resolution: Works as Designed
-
Priority: Minor - P4
-
None
-
Affects Version/s: 2.19.2
-
Component/s: None
-
None
I'm running into an issue when trying to update my project to from 2.19.1 to latest. I came across a change within 2.19.2 that is causing my code to break, and I'm curious a suggested approach to resolve or work-around. I've commented https://github.com/mongodb/mongo-csharp-driver/pull/1087#issuecomment-1816897272 my issue in further depth.
- In 2.19.1, projection is public FindExpressionProjectionDefinition
- In 2.19.2, projection is internal sealed ExpressionProjectionDefinition
var projection = Builders<DocumentEntity>.Projection.Expression(x => new SelectEntity { Name = x.Name, Email = x.Email });
I have a method that is supposed to run my projection using IQueryable via the code below, which no longer works with 2.19.2 and greater.
if (projection is FindExpressionProjectionDefinition<TDocumentEntity, TSelectEntity> expSelect)
Unknown macro: { return queryable.Select(expSelect.Expression).Cast<TReturnEntity>().ToList(); }
Please advise! Example project attached.
- is related to
-
CSHARP-4656 Simplify A : "$A" to A : 1 only on find
- Closed
-
CSHARP-4681 InvalidCastException when rendering projections
- Closed