I have a base map class(in its own assembly), where Segment property was declared as LazyLoad.
public class GroupMap : ClassMap<Group>
{
public GroupMap()
{
....
Map(x => x.Segment)
.LazyLoad();
}
}
In my application I want this property not to be a LazyLoad. I tried some methods like this:
public class MyGroupMap : GroupMap
{
public MyGroupMap() : base()
{
Map(x => x.Segment)
.Not.LazyLoad();
}
}
And Adding this class to Mappings. But it only generates a runtime exception(Property Segment was already mapped. Obvious). Any suggestions? I think Properties property might help, but it is deprecated.
I get an answer in fluent nhibernate google-group.
The main idea is to create a base mapping class(GroupMapBase) with main properties mapped. Also GroupMap class with lazyload properties.
And the MyGroupMap class based on GroupMapBase where needed properties Mapped without lazyloading.
It solved my problem.