开发者

FluentNHibernate override generic class

开发者 https://www.devze.com 2023-02-07 17:18 出处:网络
How to override the mapping of generic class? I have this class: public abstract class TranslatableEntity<TTranslation, TEntity> : Entity

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>>
{
 开发者_JAVA百科   public void Override(AutoMapping<TranslatableEntityMap<T>> mapping)
    {
        mapping.IgnoreProperty(x => x.Name);
    }
}

How can I do this? Thank you!


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


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

0

精彩评论

暂无评论...
验证码 换一张
取 消