Problème de relation avec NHibernate
Bonjour à tous,
Je cherche à comprendre l'erreur:
Citation:
Test method MvcNerdDinnerNhibernateTest.RepositoriesTest.CanCreateDinner threw exception:
NHibernate.MappingException: Association references unmapped class: Core.Domain.Model.RSVP
Dinner.cs
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
| public class Dinners
{
public Dinners()
{
RSVPs = new List<RSVP>();
}
public virtual int DinnerID { get; set; }
public virtual string Title{get;set;}
public virtual DateTime EventDate{get;set;}
public virtual string Description{get;set;}
public virtual string HostedBy{get;set;}
public virtual string ContactPhone{get;set;}
public virtual string Address{get;set;}
public virtual string Country{get;set;}
public virtual double Latitude{get;set;}
public virtual double Longitude{ get; set; }
public virtual IList<Core.Domain.Model.RSVP> RSVPs { get; set; }
} |
Dinners.hbm.xml
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
| <?xml version="1.0" encoding="utf-8" ?>
<hibernate-mapping xmlns="urn:nhibernate-mapping-2.2"
namespace="Core.Domain.Model"
assembly="Core">
<class name="Dinners" table="Dinners" dynamic-update="true">
<cache usage="read-write"/>
<id name="DinnerID" column="DinnerID" type="System.Int32">
<generator class="identity"/>
</id>
<property name="Title"/>
<property name="EventDate"/>
<property name="Description"/>
<property name="HostedBy"/>
<property name="ContactPhone"/>
<property name="Address"/>
<property name="Country"/>
<property name="Latitude"/>
<property name="Longitude"/>
<bag name="RSVPs" table="RSVP" cascade="all">
<key column="DinnerID"/>
<one-to-many class="RSVP"/>
</bag>
</class>
</hibernate-mapping> |
RSVP.cs
Code:
1 2 3 4 5 6
| public class RSVP
{
public virtual int RsvpID { get; set; }
public virtual Dinners Dinner { get; set; }
public virtual string AttendeeName { get; set; }
} |
RSVP.hbm.xml
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
| <?xml version="1.0" encoding="utf-8" ?>
<hibernate-mapping xmlns="urn:nhibernate-mapping-2.2"
namespace="NHibernateSimpleDemo"
assembly="NHibernateSimpleDemo">
<class name="RSVP" table="RSVP" lazy="false">
<id name="RsvpID">
<column name="RsvpID" />
<generator class="native" />
</id>
<property name="AttendeeName" />
<many-to-one name="Dinners" class="Dinners" column="DinnerID" cascade="all"/>
</class>
</hibernate-mapping> |
Merci d'avance (j'ai du mal à comprendre....)