I have successfully implemented a distributed cache using SQL Server by setting it up as follows:
services.AddDistributedSqlServerCache(options => { options.ConnectionString = Configuration.GetConnectionString("App"); options.SchemaName = "dbo"; options.TableName = "Cache"; }); And then I'm injecting it where I need it.
I currently can't upgrade to .NET 9 to implement the new HybridCache. In the meantime I would like to add distributed memory cache as my L1 cache. As both implementations use IDistributedCache per DI, how can I pass both implementations to my consumers?
IEnumerable<IDistributedCache>and that will give you both implementations?