diff --git a/EnvelopeGenerator.API/Program.cs b/EnvelopeGenerator.API/Program.cs index b01334b3..38119574 100644 --- a/EnvelopeGenerator.API/Program.cs +++ b/EnvelopeGenerator.API/Program.cs @@ -269,6 +269,15 @@ try // Cache options builder.Services.Configure(config.GetSection(CacheOptions.SectionName)); + // Distributed Cache - SQL Server + var sqlCacheConfig = config.GetSection("Cache:SqlServer"); + builder.Services.AddDistributedSqlServerCache(options => + { + options.ConnectionString = sqlCacheConfig["ConnectionString"] ?? connStr; + options.SchemaName = sqlCacheConfig["SchemaName"]; + options.TableName = sqlCacheConfig["TableName"]; + }); + // Envelope generator serives #pragma warning disable CS0618 // Type or member is obsolete builder.Services