Linq projections not handled correctly for select query.

Description

Projection of linq queries is not working in cases defined in test code below:

Case A
Can not project to a class which has only a default ctor. That class will be treated like the mapping class - mapper will try to assign values by comparing the fields names, while select bindings are totally ignored.
This works on driver 2.1.7 version.

Case B
If class to which we are projecting, contains a parameterized ctor and the defualt one, then although we are projecting using the parameterized ctor, the default one will be picked and the result will be same like in Case A.

Case C
If class to which we are projecting contains only a single field, then the following exception is thrown:

Cassandra.InvalidTypeException : It is not possible to convert column `col1` of type Varchar to target type TestClassSingleProp ----> System.InvalidOperationException : No coercion operator is defined between types 'System.String' and 'OntorionClient_Tests.OntorionAPI_Tests+TestClassSingleProp'.

Environment

Win 8.1

Activity

Show:
Jorge Bay Gondra
March 10, 2016, 2:59 AM

Thanks for the detailed info!

There are 2 unit tests covering projections to new types but there aren't any integration tests for it.

I'll look into it.

As a workaround, (you probably know it already) you can make the projection after the execution:

Jorge Bay Gondra
March 11, 2016, 1:58 AM

I've submitted a pull request to handle client projections and a few more tests.

Fixed

Assignee

Unassigned

Reporter

Krzysztof Cieśliński

Labels

None

Reproduced in

None

PM Priority

None

Fix versions

External issue ID

None

Doc Impact

None

Reviewer

Arthur Landim

Pull Request

None

Epic Link

None

Sprint

C# P-NEXT

Pull Requests

None

Size

None

Components

Affects versions

Priority

Major