Serhiy
Serhiy

Reputation: 4507

FluentNHibernate override generic class

How to override the mapping of generic class? I have this class:

public abstract class TranslatableEntity<TTranslation, TEntity> : Entity
{
        public virtual String Name { get;set; }

        // ...
}

And I whant to do this:

public class TranslatableEntityMap<T> : IAutoMappingOverride<TranslatableEntity<T>>
{
    public void Override(AutoMapping<TranslatableEntityMap<T>> mapping)
    {
        mapping.IgnoreProperty(x => x.Name);
    }
}

How can I do this? Thank you!

Upvotes: 0

Views: 183

Answers (2)

Petr Kozelek
Petr Kozelek

Reputation: 1126

AFAIK It is not possible. More over it has no sense to map generic class sice mapping requires the real class with implementation.

Upvotes: 1

gor
gor

Reputation: 11658

I don't think it is possible to map generic classes with NHibernate.

Upvotes: 0

Related Questions