Namespaces

Types in FluentNHibernate.Automapping

Type IAutomappingConfiguration

Namespace FluentNHibernate.Automapping

Implement this interface to control how the automapper behaves. Typically you're better off deriving from the DefaultAutomappingConfiguration class, which is pre-configured with the default settings; you can then just override specific methods that you'd like to alter.

Methods

Public instance methods

bool AbstractClassIsLayerSupertype(Type type)

Specifies whether an abstract type is considered a Layer Supertype (http://martinfowler.com/eaaCatalog/layerSupertype.html). Defaults to true for all abstract classes. Override this method if you have an abstract class that you want mapping as a regular entity.
Parameters
Type type

Abstract class type

Return
bool

Whether the type is a Layer Supertype

Access GetAccessStrategyForReadOnlyProperty(Member member)

Gets the access strategy to be used for a read-only property. This method is called for every setterless property and private-setter autoproperty in your domain that has been accepted through ShouldMap.
Parameters
Member member

Member to get access strategy for

Return
Access

Access strategy

string GetComponentColumnPrefix(Member member)

Gets the column prefix for a component.
Parameters
Member member

Member defining the component

Return
string

Component column prefix

string GetDiscriminatorColumn(Type type)

Gets the column name of the discriminator.
Parameters
Type type

Type

Return
string

Discriminator column name

IEnumerable<IAutomappingStep> GetMappingSteps(AutoMapper mapper, IConventionFinder conventionFinder)

Gets the steps that are executed to map a type.
Return
IEnumerable<IAutomappingStep>

Collection of mapping steps

Type GetParentSideForManyToMany(Type left, Type right)

Controls which side of a many-to-many relationship is considered the "parent".
Parameters
Type left

Left side of the relationship

Type right

Right side of the relationship

Return
Type

left or right

SubclassStrategy GetSubclassStrategy(Type type)

bool IsComponent(Type type)

Specifies that a particular type should be mapped as a component rather than an entity.
Parameters
Type type

Type

Return
bool

Type is a component?

bool IsConcreteBaseType(Type type)

Determines whether a type is a concrete, or instantiatable, base class. This affects how the inheritance mappings are built, specifically that any types this method returns true for will not be mapped as a subclass.
Parameters
Type type

Type

Return
bool

Base type is concrete?

bool IsDiscriminated(Type type)

Specifies whether a particular type is mapped with a discriminator. This method will be called for every type that has already been approved by ShouldMap.
Parameters
Type type

Type to check

Return
bool

Whether the type is to be discriminated

bool IsId(Member member)

Determines whether a member is the id of an entity.
This method is called for each member that ShouldMap(Type) returns true for.
Parameters
Member member

Member

Return
bool

Member is id

bool ShouldMap(Type type)

Determines whether a type should be auto-mapped. Override to restrict which types are mapped in your domain.
You normally want to override this method and restrict via something known, like Namespace.
Parameters
Type type

Type to map

Return
bool

Should map type

bool ShouldMap(Member member)

Determines whether a member of a type should be auto-mapped. Override to restrict which members are considered in automapping.
You normally want to override this method to restrict which members will be used for mapping. This method will be called for every property, field, and method on your types.
Parameters
Member member

Member to map

Return
bool

Should map member

string SimpleTypeCollectionValueColumn(Member member)

Gets the value column for a collection of simple types.
This is the name of the column.
Parameters
Member member

Collection property

Return
string

Value column name