Fixed
Details
Details
Assignee
Unassigned
UnassignedReporter
Alexander Kovtik
Alexander KovtikComponents
Fix versions
Affects versions
Priority
Who's Looking?
Open Who's Looking?
Created June 13, 2009 at 6:23 AM
Updated December 4, 2010 at 3:37 PM
Resolved August 6, 2010 at 3:29 PM
Using the following mapping
<class name="Entity">
<id name="Id">
<generator class="assigned" />
</id>
</class>
the following code causes ArgumentException: The value "1" is not of type "Entity" and cannot be used in this generic collection.
using (var s = OpenSession())
using (var t = s.BeginTransaction())
{
var futureResults = s.CreateCriteria<Entity>()
.SetResultTransformer(Transformers.RootEntity)
.Future<Entity>();
var futureResultsCount = s.CreateCriteria<Entity>()
.SetProjection(Projections.RowCount())
.FutureValue<Entity>();
//loading results
futureResults.ToArray();
}