У меня возникла следующая проблема, когда я попытался сопоставить свои классы
Stack trace:
Inner exception message: could not resolve property: Project_ID of: Messenia.Data.Models.Project
, вот моя конфигурация
private StaticHibernate () {
new NHibernate.ByteCode.Castle.ProxyFactoryFactory ();
SessionFactory = Fluently.Configure ()
.Database (MySQLConfiguration.Standard
.ConnectionString ("database=messenia;server=localhost;uid=root;pwd=root"))
.ExposeConfiguration (c => c.Properties.Add ("hbm2ddl.keywords", "none"))
.Mappings(m => m.AutoMappings.Add(AutoMap.AssemblyOf<Entity>(new EntityAutoMappingConfiguration())
.IgnoreBase<Entity>()
.UseOverridesFromAssemblyOf<Entity>()
.Conventions.Add(typeof(PrimaryKeyNamePlusId)))) .BuildSessionFactory ();
и:
public class EntityAutoMappingConfiguration : DefaultAutomappingConfiguration
{
public override bool ShouldMap(Type type)
{
return type.GetInterfaces().Contains(typeof(IPersistable));
}
}
и:
public class PrimaryKeyNamePlusId : IIdConvention
{
public void Apply(IIdentityInstance instance)
{
instance.Column(instance.EntityType.Name + "_ID");
}
}
Проект класса не содержит свойства Project_Id, но содержит идентификатор проп., Так почему я получаю эту ошибку?Благодарю .Может ли кто-нибудь помочь мне решить проблему?