If many classes implement the same interface(s), is it possible to map those interface properties in one place? There's more code @ pastebin
You can see here that classes have some common interfaces (but not all to make common base class) and I had to repeat mappings.
public class PostMapping : SubclassMap<Post>
{
public PostMapping()
{
Map(x => x.Text, "Text");
// coming from IMultiCategorizedPage
HasManyToMany(x => x.Categories).Table("PageCategories").ParentKeyColumn("PageId").ChildKeyColumn("CategoryId").Cascade.SaveUpdate();
// coming from IMultiTaggedPage
HasManyToMany(x => x.Tags).Table("PageTags").ParentKeyColumn("PageId").ChildKeyColumn("TagId").Cascade.SaveUpdate();
// coming from ISearchablePage
Map(x => ((ISearchablePage)x).SearchIndex, "SearchIndex").LazyLoad();
}
}
public class ArticleMapping : SubclassMap<Article>
{
public ArticleMapping()
{
Map(x => x.Text, "Text");
// coming from ISingleCategorizedPage
References(x => x.Category, "CategoryId");
// coming from IMultiTaggedPage
HasManyToMany(x => x.Tags).Table("PageTags").ParentKeyColumn("PageId").ChildKeyColumn("TagId").Cascade.SaveUpdate();
// coming from ISearchablePage
Map(x => ((ISearchablePage)x).SearchIndex, "SearchIndex").LazyLoad();
}
}