feat(Web): Verteilter Sql Server-Cache hinzugefügt.

- Bat-Datei erstellt, um Tabelle für Cache zu erstellen.
 - Sql-Datei zum Erstellen einer Tabelle für den Cache erstellt
This commit is contained in:
Developer 02
2024-11-29 14:08:07 +01:00
parent 9d1a2e7254
commit 2a963a1861
5 changed files with 73 additions and 2 deletions

View File

@@ -1,4 +1,3 @@
using DigitalData.UserManager.Infrastructure.Repositories;
using EnvelopeGenerator.Application.Contracts;
using EnvelopeGenerator.Application.Services;
using EnvelopeGenerator.Web.Services;
@@ -9,7 +8,6 @@ using NLog.Web;
using DigitalData.Core.API;
using Microsoft.AspNetCore.Authentication.Cookies;
using EnvelopeGenerator.Web.Models;
using DigitalData.Core.DTO;
using System.Text.Encodings.Web;
using Ganss.Xss;
using Microsoft.Extensions.Options;
@@ -81,6 +79,12 @@ try
//AddEF Core dbcontext
var connStr = config.GetConnectionString(Key.Default) ?? throw new InvalidOperationException("There is no default connection string in appsettings.json.");
builder.Services.AddDbContext<EGDbContext>(options => options.UseSqlServer(connStr));
builder.Services.AddDistributedSqlServerCache(options =>
{
options.ConnectionString = connStr;
options.SchemaName = "dbo";
options.TableName = "TBDD_CACHE";
});
// Add envelope generator services
builder.Services.AddEnvelopeGenerator(config);