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
<PackageReference Include="Arebis.Core.AspNet.SqlServer" Version="8.0.0" />
<PackageVersion Include="Arebis.Core.AspNet.SqlServer" Version="8.0.0" />
<PackageReference Include="Arebis.Core.AspNet.SqlServer" />
paket add Arebis.Core.AspNet.SqlServer --version 8.0.0
#r "nuget: Arebis.Core.AspNet.SqlServer, 8.0.0"
#:package Arebis.Core.AspNet.SqlServer@8.0.0
#addin nuget:?package=Arebis.Core.AspNet.SqlServer&version=8.0.0
#tool nuget:?package=Arebis.Core.AspNet.SqlServer&version=8.0.0
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
Install the NuGet package:
dotnet add package Arebis.Core.AspNet.SqlServerSet 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) ) GOConfigure the service in your ASP.NET application:
builder.Services.AddSqlServerDomainSettingsProvider(builder.Configuration.GetConnectionString("DefaultConnection")!);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 | Versions 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. |
-
net8.0
- Arebis.Core.AspNet (>= 8.0.3)
- Microsoft.Data.SqlClient (>= 5.2.2)
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 |