VOOZH about

URL: https://www.nuget.org/packages/Simplify.FluentNHibernate/

⇱ NuGet Gallery | Simplify.FluentNHibernate 3.3.1




👁 Image
Simplify.FluentNHibernate 3.3.1

dotnet add package Simplify.FluentNHibernate --version 3.3.1
 
 
NuGet\Install-Package Simplify.FluentNHibernate -Version 3.3.1
 
 
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Simplify.FluentNHibernate" Version="3.3.1" />
 
 
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Simplify.FluentNHibernate" Version="3.3.1" />
 
Directory.Packages.props
<PackageReference Include="Simplify.FluentNHibernate" />
 
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Simplify.FluentNHibernate --version 3.3.1
 
 
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: Simplify.FluentNHibernate, 3.3.1"
 
 
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Simplify.FluentNHibernate@3.3.1
 
 
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Simplify.FluentNHibernate&version=3.3.1
 
Install as a Cake Addin
#tool nuget:?package=Simplify.FluentNHibernate&version=3.3.1
 
Install as a Cake Tool
The NuGet Team does not provide support for this client. Please contact its maintainers for support.

Simplify.FluentNHibernate Documentation

Provides:

  • FluentConfiguration class extensions which allow you to easily configure your database connection.
  • NHibernate ISession extensions which allow you to write queries with lambda expressions.
  • FluentConfiguration extensions for schema management (ExportSchema, UpdateSchema).

Available at NuGet as binary package

Quick Start Example

Configuration through Microsoft.Extensions.Configuration

Session factory setup
namespace 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"
 }
}

Configuration through *.config files

Session factory setup
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();
 }
 }
}
Configuration file
<?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>

FluentNHibernate quick setup variants

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

Additional configuration options

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

Custom NHibernate configuration

Can be specified via lambda extension, for example, a custom dialect:

configuration.InitializeFromConfigMsSql(configSectionName, c => c.Dialect<MsSql2012Dialect>());

Session lambda extensions for data retrieval

Example

var user = session.GetSingleObject(x => x.Name == "FooName");
var users = session.GetList(x => x.Name.StartsWith("A"));

More examples here

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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on Simplify.FluentNHibernate:

Package Downloads
Simplify.Repository.FluentNHibernate

Simplify.Repository FluentNHibernate implementation

GitHub repositories

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
Loading failed