I have a property mapped like this:
Code:
[Serializable]
public enum EstadosNecesidadMaterial {cancelada, modificada, cubierta, pendiente};
[Serializable]
[Persistent]
public class NecesidadMaterial: BOBase
{
...
[Persistent]
public virtual EstadosNecesidadMaterial Estado
{
get
{
....
}
}
....
}
<?xml version="1.0"?>
<hibernate-mapping xmlns="urn:nhibernate-mapping-2.0" default-access="field">
<class name="Einsa.Nautilus.BOL.NecesidadMaterial, Einsa.Nautilus.BOL" table="NecesidadMaterial" lazy="false">
<jcs-cache usage="read-write" />
<id name="idNecesidadMaterial" column="idNecesidadMaterial" type="Guid" unsaved-value="{00000000-0000-0000-0000-000000000000}">
<generator class="guid" />
</id>
....
<property name="Estado" column="Estado" access="Einsa.Nautilus.DAL.ReadOnlyPropertyAccessor, Einsa.Nautilus.DAL" />
...
</class>
</hibernate-mapping>
when NHibernate try to find the type of Estado by refection, not found this type and then the next code:
Code:
try
{
// first try the named strategy since that will be the most likely strategy used.
accessor = ( IPropertyAccessor ) PropertyAccessorFactory.PropertyAccessors[ propertyAccessorName ];
return accessor.GetGetter( theClass, propertyName );
}
catch( PropertyNotFoundException )
{
....
}
fails
PropertyAccessorFactory.PropertyAccessors[ propertyAccessorName ] don't have the type and then return null => accessor = null
Then accessor.GetGetter throw an exception diferently PropertyNotFoundException
this exception isn't capture by another method => assembly fail.
I think that if change PropertyNotFoundException by Exception the problem is solve, but there isn