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'.
Win 8.1
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:
I've submitted a pull request to handle client projections and a few more tests.