Arebis.Core.AspNet.SqlServer 8.0.0

dotnet add package Arebis.Core.AspNet.SqlServer --version 8.0.0
                    
NuGet\Install-Package Arebis.Core.AspNet.SqlServer -Version 8.0.0
                    
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="Arebis.Core.AspNet.SqlServer" Version="8.0.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Arebis.Core.AspNet.SqlServer" Version="8.0.0" />
                    
Directory.Packages.props
<PackageReference Include="Arebis.Core.AspNet.SqlServer" />
                    
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 Arebis.Core.AspNet.SqlServer --version 8.0.0
                    
#r "nuget: Arebis.Core.AspNet.SqlServer, 8.0.0"
                    
#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 Arebis.Core.AspNet.SqlServer@8.0.0
                    
#: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=Arebis.Core.AspNet.SqlServer&version=8.0.0
                    
Install as a Cake Addin
#tool nuget:?package=Arebis.Core.AspNet.SqlServer&version=8.0.0
                    
Install as a Cake Tool

Arebis.Core.AspNet.SqlServer

SQL Server based extensions for ASP.NET.

Domain Settings

Domain Settings allow you to manage domain specific settings in your ASP.NET applications using SQL server as storage.

Installation

  1. Install the NuGet package:

    dotnet add package Arebis.Core.AspNet.SqlServer
    
  2. Set up the required database table by executing the following SQL script:

    CREATE TABLE [config].[DomainSettings]
    (
        [Id] int IDENTITY(1,1) NOT NULL,
     [DomainName] varchar(200) NOT NULL,
     [Key] nvarchar(200) NULL,
     [Value] nvarchar(max) NULL,
     [AliasFor] varchar(200) NULL,
     CONSTRAINT [PK_DomainSettings] PRIMARY KEY CLUSTERED ([Id] ASC)
    ) ON [PRIMARY]
    GO
    
    CREATE UNIQUE NONCLUSTERED INDEX [IX_DomainSettings_DomainName_Key] ON [config].[DomainSettings] ([DomainName] ASC, [Key] ASC)
    GO
    
    ALTER TABLE [config].[DomainSettings]
    ADD CONSTRAINT CK_DomainSettings_Key_XOR_Alias
    CHECK (
        ([Key] IS NOT NULL AND [AliasFor] IS NULL)
     OR ([Key] IS NULL AND [Value] IS NULL AND [AliasFor] IS NOT NULL)
    )
    GO
    
  3. Configure the service in your ASP.NET application:

    builder.Services.AddSqlServerDomainSettingsProvider(builder.Configuration.GetConnectionString("DefaultConnection")!);
    
  4. Also make sure to have registered an IDistributedCache implementation:

    builder.Services.AddDistributedMemoryCache();
    

    (Note: use the DistributedMemoryCache only for testing or for single-server scenarios.)

Usage

You can use the IDomainSettingsProvider interface to manage domain settings in your application. Here's an example of how to use it:

public class HomeController : Controller
{
    private readonly IDomainSettingsProvider domainSettingsProvider;

    public HomeController(IDomainSettingsProvider domainSettingsProvider)
    {
        this.domainSettingsProvider = domainSettingsProvider;
    }

    public async Task<IActionResult> Index()
    {
        var settings = await this.domainSettingsProvider.GetDomainSettingsAsync();
        ViewBag.Tenant = settings["Tenant"];
        return View();
    }
}

Following methods are available on the IDomainSettingsProvider interface:

  • Task<IDictionary<string, string?>> GetDomainSettingsAsync(string domainName, CancellationToken cancellationToken = default);

  • Task SetDomainAliasAsync(string domainName, string aliasFor, CancellationToken cancellationToken = default);

  • Task SetDomainSettingAsync(string domainName, IDictionary<string, string?> settings, CancellationToken cancellationToken = default);

  • Task DeleteDomainAsync(string domainName, CancellationToken cancellationToken = default);

Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  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.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows 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
8.0.0 162 1/19/2026