I'm getting desperate trying to get a class to map. I just get "No persister found: ChickenPing.Core.Substitution". That class is in one assembly, and all of me NHibernate classes are in a difference assembly. I'd really appreciate any help, my code is below.
Code:
<?xml version="1.0" encoding="utf-8" ?>
<hibernate-mapping xmlns="urn:nhibernate-mapping-2.2" assembly="ChickenPing.Core" namespace="ChickenPing.Core">
<class name="ChickenPing.Core.Substitution, ChickenPing.Core" table="Subs">
<id name="ID" column="ID">
<generator class="guid"/>
</id>
<property name="Ingredient" column="ingredient" not-null="true"/>
<property name="Substitutes" column="substitutes" not-null="true"/>
<property name="Measurement" column="measurement"/>
<property name="Quantity" column="quantity"/>
</class>
</hibernate-mapping>
namespace ChickenPing.Core {
public class Substitution {
protected Guid id;
protected string ingredient,
measurement,
substitutes;
protected double? quantity;
/// <summary>
/// Gets or sets the database ID for this substitution.
/// </summary>
/// <value>The database ID for this substitution.</value>
public virtual Guid ID {
get { return id; }
set { id = value; }
}
/// <summary>
/// Gets or sets the ingredient name.
/// </summary>
/// <value>The name.</value>
public virtual string Ingredient {
get { return ingredient; }
set { ingredient = value; }
}
/// <summary>
/// Gets or sets the name of the unit used to measure this ingredient.
/// </summary>
/// <value>The name of the unit used to measure this ingredient.</value>
public virtual string Measurement {
get { return measurement; }
set { measurement = value; }
}
/// <summary>
/// Gets or sets the quantity of the ingredient.
/// </summary>
/// <value>The quantity.</value>
public virtual double? Quantity {
get { return quantity; }
set { quantity = value; }
}
/// <summary>
/// Gets or sets the substitutes which can be used for this ingredient.
/// </summary>
/// <value>The substitutes which can be used for this ingredient..</value>
public virtual string Substitutes {
get { return substitutes; }
set { substitutes = value; }
}
/// <summary>
/// Initializes a new blank <see cref="Ingredient"/>.
/// </summary>
public Substitution() {
...
The assembly is added when I create my configuration with:
Code:
config.AddAssembly(typeof(Substitution).Assembly);