Hi, I use this to create full-text directories on the M $ Sql ββserver using almost the same FluentNhibernate mapping mechanism.
From the configuration, I get a list of persistentClasses
this.persistenClasses = configuration.ClassMappings;
Next, I go through this list to find my persistenClass class by its generic class class
var genericDefinition = mappingClass.BaseType.GetGenericArguments()[0]; var matchedPersistClass = FindPersistedClassFrom(genericDefinition); private PersistentClass FindPersistedClassFrom(Type genericDefinition) { return persistentClasses.FirstOrDefault(x => x.EntityName == genericDefinition.FullName); }
Thus, having persistentClass, you easily get access to table names, properties, db fields, etc.
TableName = matchedPersistClass.Table.Name,
isuruceanu
source share