Data Access

Baked uses NHibernate and FluentNHibernate library when providing data access layer.

app.Layers.AddDataAccess();

Configuration Targets

This layer provides PersistenceConfiguration, AutomappingConfigurationAutoPersistenceModel, InterceptorConfiguration, FluentConfiguration for configuring NHibernate behavior and IDatabaseInitializationCollection for configuring database initialization actions.

PersistenceConfiguration

This target is provided in AddServices phase. To configure it in a feature;

configurator.ConfigurePersistence(persistence =>
{
    ...
});

InterceptorConfiguration

This target is provided in AddServices phase right after PersistenceConfiguration. To configure it in a feature;

configurator.ConfigureNHibernateInterceptor(interceptor =>
{
    ...
});

AutomappingConfiguration

This target is provided in AddServices phase right after InterceptorConfiguration. To configure it in a feature;

configurator.ConfigureAutomapping(automapping =>
{
    ...
});

AutoPersistenceModel

This target is provided in AddServices phase right after AutomappingConfiguration. To configure it in a feature;

configurator.ConfigureAutoPersistenceModel(autoPersistenceModel =>
{
    ...
});

FluentConfiguration

This target is provided in AddServices phase. To configure it in a feature;

configurator.ConfigureFluentConfiguration(fluentConfiguration =>
{
    ...
});

IDatabaseInitializationCollection

This target is provided in PostBuild phase. To configure it in a feature;

configurator.ConfigureDatabaseInitializationCollection(initializations =>
{
    ...
});