![]() |
VOOZH | about |
dotnet add package Simplify.FluentNHibernate --version 3.3.1
NuGet\Install-Package Simplify.FluentNHibernate -Version 3.3.1
<PackageReference Include="Simplify.FluentNHibernate" Version="3.3.1" />
<PackageVersion Include="Simplify.FluentNHibernate" Version="3.3.1" />Directory.Packages.props
<PackageReference Include="Simplify.FluentNHibernate" />Project file
paket add Simplify.FluentNHibernate --version 3.3.1
#r "nuget: Simplify.FluentNHibernate, 3.3.1"
#:package Simplify.FluentNHibernate@3.3.1
#addin nuget:?package=Simplify.FluentNHibernate&version=3.3.1Install as a Cake Addin
#tool nuget:?package=Simplify.FluentNHibernate&version=3.3.1Install as a Cake Tool
Provides:
FluentConfiguration class extensions which allow you to easily configure your database connection.ISession extensions which allow you to write queries with lambda expressions.FluentConfiguration extensions for schema management (ExportSchema, UpdateSchema).Available at NuGet as binary package
Microsoft.Extensions.Configurationnamespace MyApp.Database
{
public class MyDbSessionFactoryBuilder
{
private readonly ISessionFactory _instance;
public ISessionFactory Instance => _instance;
public MyDbSessionFactoryBuilder(IConfiguration cfg, string configSectionName = "MyDatabaseConnectionSettings")
{
var configuration = Fluently.Configure();
configuration.InitializeFromConfigMsSql(cfg, configSectionName);
configuration.AddMappingsFromAssemblyOf<MyDbSessionFactoryBuilder>();
_instance = configuration.BuildSessionFactory();
}
}
}
IConfiguration settings example based on appsettings.json{
"MyDatabaseConnectionSettings":
{
"ServerName": "Server name",
"DataBaseName": "database name",
"UserName": "user name",
"UserPassword": "password"
}
}
namespace MyApp.Database
{
public class MyDbSessionFactoryBuilder
{
private readonly ISessionFactory _instance;
public ISessionFactory Instance => _instance;
public MyDbSessionFactoryBuilder(string configSectionName = "MyDatabaseConnectionSettings")
{
var configuration = Fluently.Configure();
configuration.InitializeFromConfigMsSql(configSectionName);
configuration.AddMappingsFromAssemblyOf<MyDbSessionFactoryBuilder>();
_instance = configuration.BuildSessionFactory();
}
}
}
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<configSections>
<section name="MyDatabaseConnectionSettings" type="System.Configuration.NameValueSectionHandler, System, Version=1.0.5000.0,Culture=neutral, PublicKeyToken=b77a5c561934e089" />
</configSections>
<MyDatabaseConnectionSettings>
<add key="ServerName" value="Server name" />
<add key="DataBaseName" value="database name" />
<add key="UserName" value="user name" />
<add key="UserPassword" value="password" />
</MyDatabaseConnectionSettings>
</configuration>
| Database type | Method | Comment |
|---|---|---|
| Microsoft SQL Server | InitializeFromConfigMsSql | Connection using System.Data.SqlClient (System.Data under .NET framework) managed driver |
| Microsoft SQL Server | InitializeFromConfigMsSqlMicrosoftDriver | Connection using Microsoft.Data.SqlClient managed driver |
| MySQL | InitializeFromConfigMySql | Connection using MySql.Data managed driver |
| PostgreSQL | InitializeFromConfigPostgreSql | Connection using Npgsql managed driver |
| Oracle | InitializeFromConfigOracleOdpNet | Connection using Oracle.ManagedDataAccess managed driver (recommended for Oracle) |
| Oracle | InitializeFromConfigOracleOdpNetNative | Connection using odp.net.x86 or odp.net.x64 unmanaged drivers |
| Oracle | InitializeFromConfigOracleClient | Connection using Oracle.DataAccess.x86 or Oracle.DataAccess.x64 unmanaged drivers |
| SQLite | InitializeFromConfigSqLite | Connection using System.Data.SQLite managed driver |
| SQLite | InitializeFromConfigSqLiteInMemory | Connection using System.Data.SQLite managed driver using in-memory database |
| Option Name | Type | Description |
|---|---|---|
| Port | int | Database port number |
| ShowSql | bool | Executed SQL queries can be displayed (in the output specified in the ShowSqlOutputType parameter) by setting ShowSql option, default value is false |
| ShowSqlOutputType | ShowSqlOutputType | Sets the executed SQL commands output type. Possible values: Console, Trace. Default value is: Console |
Can be specified via lambda extension, for example, a custom dialect:
configuration.InitializeFromConfigMsSql(configSectionName, c => c.Dialect<MsSql2012Dialect>());
var user = session.GetSingleObject(x => x.Name == "FooName");
var users = session.GetList(x => x.Name.StartsWith("A"));
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net5.0 net5.0 was computed. net5.0-windows net5.0-windows was computed. net6.0 net6.0 was computed. net6.0-android net6.0-android was computed. net6.0-ios net6.0-ios was computed. net6.0-maccatalyst net6.0-maccatalyst was computed. net6.0-macos net6.0-macos was computed. net6.0-tvos net6.0-tvos was computed. net6.0-windows net6.0-windows was computed. net7.0 net7.0 was computed. net7.0-android net7.0-android was computed. net7.0-ios net7.0-ios was computed. net7.0-maccatalyst net7.0-maccatalyst was computed. net7.0-macos net7.0-macos was computed. net7.0-tvos net7.0-tvos was computed. net7.0-windows net7.0-windows was computed. net8.0 net8.0 is compatible. net8.0-android net8.0-android was computed. net8.0-browser net8.0-browser was computed. net8.0-ios net8.0-ios was computed. net8.0-maccatalyst net8.0-maccatalyst was computed. net8.0-macos net8.0-macos was computed. net8.0-tvos net8.0-tvos was computed. net8.0-windows net8.0-windows was computed. net9.0 net9.0 is compatible. net9.0-android net9.0-android was computed. net9.0-browser net9.0-browser was computed. net9.0-ios net9.0-ios was computed. net9.0-maccatalyst net9.0-maccatalyst was computed. net9.0-macos net9.0-macos was computed. net9.0-tvos net9.0-tvos was computed. net9.0-windows net9.0-windows was computed. net10.0 net10.0 is compatible. net10.0-android net10.0-android was computed. net10.0-browser net10.0-browser was computed. net10.0-ios net10.0-ios was computed. net10.0-maccatalyst net10.0-maccatalyst was computed. net10.0-macos net10.0-macos was computed. net10.0-tvos net10.0-tvos was computed. net10.0-windows net10.0-windows was computed. |
| .NET Core | netcoreapp2.0 netcoreapp2.0 was computed. netcoreapp2.1 netcoreapp2.1 was computed. netcoreapp2.2 netcoreapp2.2 was computed. netcoreapp3.0 netcoreapp3.0 was computed. netcoreapp3.1 netcoreapp3.1 was computed. |
| .NET Standard | netstandard2.0 netstandard2.0 is compatible. netstandard2.1 netstandard2.1 is compatible. |
| .NET Framework | net461 net461 was computed. net462 net462 was computed. net463 net463 was computed. net47 net47 was computed. net471 net471 was computed. net472 net472 was computed. net48 net48 is compatible. net481 net481 was computed. |
| MonoAndroid | monoandroid monoandroid was computed. |
| MonoMac | monomac monomac was computed. |
| MonoTouch | monotouch monotouch was computed. |
| Tizen | tizen40 tizen40 was computed. tizen60 tizen60 was computed. |
| Xamarin.iOS | xamarinios xamarinios was computed. |
| Xamarin.Mac | xamarinmac xamarinmac was computed. |
| Xamarin.TVOS | xamarintvos xamarintvos was computed. |
| Xamarin.WatchOS | xamarinwatchos xamarinwatchos was computed. |
Showing the top 1 NuGet packages that depend on Simplify.FluentNHibernate:
| Package | Downloads |
|---|---|
|
Simplify.Repository.FluentNHibernate
Simplify.Repository FluentNHibernate implementation |
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 3.3.1 | 91 | 6/25/2026 |
| 3.3.0 | 958 | 6/15/2025 |
| 3.2.1 | 1,322 | 12/1/2024 |
| 3.2.0 | 628 | 4/26/2024 |
| 3.1.0 | 258 | 3/24/2024 |
| 3.0.0 | 1,656 | 1/14/2024 |
| 2.6.0 | 646 | 8/7/2023 |
| 2.5.3 | 3,088 | 4/15/2023 |
| 2.5.2 | 462 | 2/27/2023 |
| 2.5.1 | 2,198 | 10/27/2021 |
| 2.5.0 | 2,437 | 1/21/2021 |
| 2.4.0 | 1,419 | 11/17/2020 |
| 2.3.0 | 1,231 | 10/7/2020 |
| 2.2.0 | 3,015 | 4/17/2020 |
| 2.2.0-pre01 | 658 | 4/17/2020 |
| 2.1.0 | 1,420 | 3/4/2020 |
| 2.0.0 | 1,916 | 10/28/2019 |
| 1.9.0 | 8,375 | 12/13/2018 |
| 1.8.0 | 2,372 | 5/6/2018 |
| 1.7.0 | 1,668 | 3/5/2018 |