Xtensive.Orm.Web 6.0.13

There is a newer version of this package available.
See the version list below for details.
dotnet add package Xtensive.Orm.Web --version 6.0.13
NuGet\Install-Package Xtensive.Orm.Web -Version 6.0.13
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="Xtensive.Orm.Web" Version="6.0.13" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Xtensive.Orm.Web --version 6.0.13
#r "nuget: Xtensive.Orm.Web, 6.0.13"
#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.
// Install Xtensive.Orm.Web as a Cake Addin
#addin nuget:?package=Xtensive.Orm.Web&version=6.0.13

// Install Xtensive.Orm.Web as a Cake Tool
#tool nuget:?package=Xtensive.Orm.Web&version=6.0.13

Xtensive.Orm.Web

Summary

The extension adds integration for DataObjects.Net Core and ASP.NET Core. It contains SessionManager class which is middleware and can be used as part of ASP.NET Core Pipeline. SessionManager opens session and transaction on going down the pipeline and disposes them on going up the pipeline.

SessionManager has the following features:

  1. When Session.Current is accessed, and there is no current Session, it will provide a new instance of Session. In that case a new transaction will be created. It will be committed when the pipeline execution returns to SessionManager without any exception, otherwise it will be rolled back.
  2. Setting SessionManager.Demand().HasErrors to true will lead to rollback of this transaction.
  3. SessionManager.Current (and SessionManager.Demand()) returns the instance of SessionManager bound to the current pipeline execution, i.e. current SessionManager. Its Session property (if not null) is the same value as the one provided by Session.Current.

Note that presence of SessionManager does not prevent you from creating Sessions manually. It operates relying on Session.Resolver event, which is raised only when there is no current Session.

Finally, no automatic Session + transaction will be provided, if you don't use Session.Current/Session.Demand() methods in your code (directly or indirectly). So e.g. requests to static web pages won't lead to any DB interaction.

Prerequisites

DataObjects.Net 6.0.x or later (http://dataobjects.net)

Implementation

To start using SessionManager it should be added to ASP.NET Middleware pipeline in Startup class like in example below

public class Startup
{
  public Startup(IConfiguration configuration)
  {
    
  }

  public void ConfigureServices(IServiceCollection services)
  {
    // Configure services
  }

  public void Configure(IApplicationBuilder app, IHostingEnvironment env)
  {
    // Configure parts of the pipeline which are before SessionManager.
    // It will be unable to use SessionManager functionality in these parts
    // For instance,
    app.UseStaticFiles()

    // Add session manager to the pipeline
    app.UseSessionManager();

    // Configure parts of the pipeline which are after SessionManager. 
    // These parts will work with SessionManager.

    // For instance, MVC controllers will be able to query data using DataObjects.Net
    app.UseMvc(routes =>
    {
      routes.MapRoute(
                name: "default",
                template: "{controller=Home}/{action=Index}/{id?}");
    });
  }
}
Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed. 
.NET Core netcoreapp2.0 is compatible.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
7.2.0-Beta-1 360 12/28/2023
7.1.1 465 11/14/2023
7.1.0 792 4/12/2023
7.1.0-RC 635 3/9/2023
7.1.0-Beta-2 684 12/19/2022
7.1.0-Beta-1 696 7/4/2022
7.0.4 427 11/12/2023
7.0.3 1,088 3/21/2022
7.0.2 1,048 2/8/2022
7.0.1 954 10/29/2021
7.0.0 929 6/2/2021
6.0.13 100 4/4/2024
6.0.12 416 11/10/2023
6.0.11 851 1/12/2023
6.0.10 982 4/29/2022
6.0.9 1,004 2/2/2022
6.0.8 948 10/28/2021
6.0.7 918 8/27/2021
6.0.6 982 5/24/2021
6.0.5 1,019 3/9/2021
6.0.4 1,115 12/22/2020
6.0.3 1,087 9/29/2020
6.0.0 1,241 1/28/2020
5.1.0-Beta-1 4,960 1/30/2015
5.0.24 916 4/27/2021
5.0.23 990 2/4/2021
5.0.22 1,133 11/18/2020
5.0.21 1,094 11/6/2020
5.0.20 1,251 12/25/2019
5.0.19 1,320 5/30/2019
5.0.19-Beta-2 984 4/16/2019
5.0.19-Beta-1 1,084 12/29/2018
5.0.18 1,545 9/28/2018
5.0.18-Beta-3 1,263 7/2/2018
5.0.18-Beta-2 1,347 6/6/2018
5.0.18-Beta-1 1,374 4/24/2018
5.0.17 1,656 2/27/2018
5.0.17-Beta-3 1,340 2/12/2018
5.0.17-Beta-2 1,442 1/12/2018
5.0.17-Beta-1 1,448 12/28/2017
5.0.16 1,538 12/1/2017
5.0.16-Beta-1 1,302 9/27/2017
5.0.15 1,509 8/1/2017
5.0.14 1,617 6/19/2017
5.0.13 1,633 3/22/2017
5.0.12 1,668 2/14/2017
5.0.11 1,645 1/26/2017
5.0.11-RC2 1,406 12/16/2016
5.0.11-RC 1,648 9/20/2016
5.0.10 1,668 8/5/2016
5.0.10-RC 1,408 6/30/2016
5.0.9 3,238 3/3/2016
5.0.8 1,722 2/15/2016
5.0.7 1,698 1/27/2016
5.0.7-RC2 1,408 12/8/2015
5.0.7-RC 1,473 9/10/2015
5.0.6 1,805 7/3/2015
5.0.5 1,911 4/23/2015
5.0.4 1,698 3/19/2015
5.0.4-RC 1,776 2/25/2015
5.0.3 2,071 10/31/2014
5.0.2 1,790 9/11/2014
5.0.0 1,804 8/15/2014
5.0.0-RC2 1,481 8/1/2014
5.0.0-RC 1,493 7/21/2014
5.0.0-Beta-3 1,472 5/28/2014
5.0.0-Beta-2 1,572 2/28/2014
5.0.0-Beta-1 1,582 11/14/2013
4.6.9 1,611 7/3/2015
4.6.8 1,760 8/1/2014
4.6.7 1,749 6/23/2014
4.6.6 1,928 4/9/2014
4.6.5 1,803 1/7/2014
4.6.4 1,949 9/30/2013
4.6.3 1,880 2/4/2013
4.6.2 2,128 11/28/2012
4.6.0 2,036 10/11/2012
4.6.0-RC 1,696 10/4/2012
4.5.8 1,756 9/30/2013
4.5.7 1,733 2/4/2013
4.5.6 1,997 11/28/2012
4.5.5 1,940 10/11/2012
4.5.5-RC 1,632 10/4/2012
4.5.3 2,199 8/6/2012
4.5.2 2,346 5/10/2012
4.5.0 2,076 3/13/2012