On May 26, 12:21 am, Fabio Maulo <
fabioma...@gmail.com> wrote:
> The exception is clear.
Yes, it is :).
But I don't understand how to solve it.
> What is not clear is UniqueEntityMapping<T>
> btw you are wrongly creating an instance of PropertyPath passing a null as
> localMember
I can publish the latest version of source code.
Btw the base class of UniqueEntityMapping<T> is:
public abstract class EntityMapping<TEntity> :
IEntityMapping<TEntity>
where TEntity : IUniqueEntity
{
private readonly IDictionary<object, Action<IPropertyMapper>>
properties =
new Dictionary<object, Action<IPropertyMapper>>();
private readonly IDictionary<object, FluentPropertyMapper>
properties2 =
new Dictionary<object, FluentPropertyMapper>();
public IEnumerable<KeyValuePair<object, Action<IPropertyMapper>>>
Properties
{
get { return properties; }
}
public IEnumerable<KeyValuePair<object, FluentPropertyMapper>>
Properties2
{
get { return properties2; }
}
public Action<IIdMapper> IdMapper
{
get; private set;
}
public virtual MappingStrategies Strategy
{
get { return MappingStrategies.TablePerClass; }
}
public void Id(Action<IIdMapper> idMapper)
{
IdMapper = idMapper;
}
public FluentPropertyMapper
FluentProperty<TProperty>(Expression<Func<TEntity, TProperty>>
property)
{
var propertyMember =
typeof(TEntity)
.GetProperty(ExpressionHelper<TEntity>.GetPropertyName(property),
BindingFlags.Instance | BindingFlags.Public);
var fluentPropertyMapper = new FluentPropertyMapper(propertyMember,
new NHibernate.Cfg.MappingSchema.HbmProperty());
properties2.Add(property, fluentPropertyMapper);
return fluentPropertyMapper;
}
public void Property<TProperty>(Expression<Func<TEntity, TProperty>>
property, Action<IPropertyMapper> action)
{
properties.Add(property, action);
}
}
Thx again!
> On Wed, May 25, 2011 at 2:59 PM, Matteo Migliore
> <
matteo.migli...@gmail.com>wrote: