Good morning, given those entities/mappings
Visual studio 2010 beta 2. entities and test projects are on Framework
4.0 (beta2 i suppose)
but i tried with entities with framework 3.5 (test project are
supported only on 4.0)
public class Person
{
public virtual int Id { get; set; }
public virtual String FirstName { get; set; }
public virtual String LastName { get; set; }
}
public class Thing
{
public virtual int Id { get; set; }
public virtual String Name { get; set; }
public virtual Person Owner { get; set; }
}
<?xml version="1.0" encoding="utf-8" ?>
<hibernate-mapping xmlns="urn:nhibernate-mapping-2.2"
assembly="NH3.DomainModel" namespace="NH3.DomainModel">
<class name="Person" table="Person" >
<id name="Id" column="Id" type="Int32">
<generator class="native"/>
</id>
<property name="FirstName" type="String" column="FirstName" />
<property name="LastName" type="String" column="LastName" />
</class>
</hibernate-mapping>
<?xml version="1.0" encoding="utf-8" ?>
<hibernate-mapping xmlns="urn:nhibernate-mapping-2.2"
assembly="NH3.DomainModel" namespace="NH3.DomainModel">
<class name="Thing" table="Thing" >
<id name="Id" column="Id" type="Int32">
<generator class="native"/>
</id>
<property name="Name" type="String" column="Name" />
<many-to-one name="Owner" class="Person" column="Owner" foreign-
key="Owner" cascade="none" />
</class>
</hibernate-mapping>
and this Test :
Person p = session.Load<Person>(1);
Thing t = session.Load<Thing>(1);
IList<Thing> list = (from Thing item in session.Query<Thing>() select
item).ToList<Thing>();
the first two statements works great
the third one with linq, give this exception:
"The CastResultOperator result operator is not current supported"
I tried googling, the only reference of CastResultOperator is
/// <summary>
/// Represents the "Cast" part of a query. This is a result
operator, operating on the whole result set of a query.
/// </summary>
/// <example>
/// In C#, the "Cast" clause in the following example corresponds to
a <see cref="CastResultOperator"/>.
/// <code>
/// var query = (from s in Students
/// select s.ID).Cast<int>();
/// </code>
/// </example>
Where am I doing wrong? Something with mappings? Or it's .net 4.0?
thanks
--
You received this message because you are subscribed to the Google Groups
"nhusers" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/nhusers?hl=en.