What you could do is to inherit your classes from AbstractMap<T>
and this AbstractMap<T>
inherits from ClassMap<T>
, so on the constructor you could call the DynamicUpdate()
.
public class AbstractMap<T> : ClassMap<T>
{
public AbstractMap()
{
DynamicUpdate();
}
}
public class CStatMessagesVOMap : AbstractMap<CstatMessagesVO>
{
public CStatMessagesVOMap()
{
Table("TBCSTATMESSAGES");
Id(x => x.Id);
Map(x => x.Cstat).Not.Nullable();
Map(x => x.Message).Length(500).Not.Nullable();
Map(x => x.Allowed).Not.Nullable();
References(x => x.DocumentKind).Column("DOCUMENTKIND").Cascade.None();
}
In this case, all classes inherited from AbstractMap<T>
would call the method you want.