---
title: SqlServerConfigurationFactory
summary: API reference for SqlServerConfigurationFactory.
status: draft
owner: Framework
last_reviewed: 2026-09-15
library: SAIF.Framework.Data.NHibernate
reference_type: package
---

# SqlServerConfigurationFactory

`SqlServerConfigurationFactory` is the SQL Server-specific implementation of `ConfigurationFactoryBase`, supplying the `MsSqlConfiguration.MsSql2008` dialect/driver configuration and the `SqlServer.config` serialized-configuration file name. It is constructed by `SqlServerUnitOfWorkFactory` to build SQL Server-targeted NHibernate configurations (there is no stateless SQL Server unit-of-work factory in this library).

## Purpose
- Provides the SQL Server-specific `GetNewConfiguration` override: configures `Fluently.Configure()` with `MsSqlConfiguration.MsSql2008`, and scans this assembly (via `AddFromAssemblyOf<IUnitOfWorkFactory>()`) plus any assemblies passed via the `ClassMapAssemblyList` constructor parameter for `ClassMap<T>` mappings.
- Provides the SQL Server-specific `GetConfigurationFileName` override, returning `SqlServer.config` as the serialized-configuration cache file name.

## Context
- Namespace: `SAIF.Data.NHibernate`
- Assembly/package: `SAIF.Framework.Data.NHibernate`

## Public members
| Member | Signature | Purpose |
| --- | --- | --- |
| SqlServerConfigurationFactory() | `public SqlServerConfigurationFactory()` | Default constructor; scans only this assembly for `ClassMap<T>` mappings. |
| SqlServerConfigurationFactory(assemblies) | `public SqlServerConfigurationFactory(IEnumerable<Assembly> assemblies)` | Constructor accepting additional assemblies to scan for `ClassMap<T>` mappings beyond this library's own 42 mapping classes. |

## Inherited public members

Members in this section are inherited from `ConfigurationFactoryBase` in `SAIF.Framework.Data.NHibernate`. They are available on this type through inheritance.

| Member | Signature | Purpose | Origin |
| --- | --- | --- | --- |
| GetConfiguration | `PersistenceConfiguration GetConfiguration(string connection, int batchSize, bool showSql)` | Returns a cached `PersistenceConfiguration` for `connection` if one exists; otherwise builds and caches one via `CreateConfiguration`. | `SAIF.Framework.Data.NHibernate` — `ConfigurationFactoryBase` |

## Behavioral notes
- Targets `MsSql2008` specifically, which affects available SQL syntax NHibernate generates for this engine.*

## Constraints and usage notes
- Consumers must pass a SQL Server-compatible connection string; no runtime validation of the connection string's target engine is performed by this class.

> **Note:** Statements marked with * were inferred from code structure, naming conventions, or
> contextual evidence where direct confirmation was not available in source artifacts.

## Sources
- `Factories/SqlServerConfigurationFactory.cs`
- `Factories/ConfigurationFactoryBase.cs`
