public static IConfigurationProvider CreateConfigurationProvider() { var configFilePath = PathHelpers.InCurrentAppDomain(Constants.NHibernateConfigFileName); var configuration = new Configuration(); configuration.Configure(configFilePath); var mapper = new ConventionModelMapper(); mapper.WithConventions(); mapper.WithMappings(configuration); return(new ConfigurationProvider(configuration)); }