skip to Main Content

Asp.net – Can you run the IConfiguration Build in a 3rd party library

If I put this code in a 3rd party library I'm building. public class AsyncDb2Read { private readonly DB2Connection connection; public AsyncDb2Read() { var assembly = System.Reflection.Assembly.GetEntryAssembly(); var c = new ConfigurationBuilder() .AddUserSecrets(assembly, true) .SetBasePath(Directory.GetCurrentDirectory()) .AddJsonFile("appsettings.json", optional: true, reloadOnChange: true)…

VIEW QUESTION

How to avoid duplicate notifications when subscribing multiple times to the same Redis channel?

I have an issue where, if I subscribe multiple times to the same Redis channel, my subscribers start receiving duplicate messages. Here is my subscription method: public void SubscribeToUserNotifications(string userId, Action<string?> onMessage) { _subscriber.Subscribe ( new RedisChannel($"orders:notifications:user:{userId}", RedisChannel.PatternMode.Literal), (channel, message)…

VIEW QUESTION
Back To Top
Search