File tree Expand file tree Collapse file tree 1 file changed +6
-3
lines changed
Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Original file line number Diff line number Diff line change 66using OpenTelemetry . Trace ;
77using Serilog ;
88using SharedLibrary ;
9+ using SharedLibrary . Cache ;
910using SharedLibrary . Middlewares ;
1011using System . Reflection ;
1112using System . Text ;
2526
2627builder . Host . UseSerilog ( ) ;
2728
28- Console . WriteLine ( $ "Environment: { builder . Environment . EnvironmentName } ") ;
29- Console . WriteLine ( $ "Connection: { builder . Configuration . GetConnectionString ( "DefaultConnection" ) } ") ;
29+ var env = builder . Environment . EnvironmentName ;
30+ builder . Services . AddRedisCacheSupport ( builder . Configuration , $ "{ env } :") ;
31+
32+ builder . Services . AddScoped < ICacheAccessProvider , CacheAccessProvider > ( ) ;
3033
3134// DB connection string (SQL Server example)
3235builder . Services . AddDbContext < AppDbContext > ( options =>
5962builder . Services . AddHttpContextAccessor ( ) ;
6063
6164builder . Services . AddControllersWithViews ( ) ;
62- builder . Services . AddMemoryCache ( ) ;
65+
6366
6467// Learn more about configuring OpenAPI at https://aka.ms/aspnet/openapi
6568builder . Services . AddEndpointsApiExplorer ( ) ;
You can’t perform that action at this time.
0 commit comments