Injecting IOptions to static class
Injecting IOptions<> to static class I would like to keep the class as static. Is there any workaround to inject IOptions<EncryptionSettings> without modifying the access modifier? IOptions<EncryptionSettings> public static class Encrypter { private static readonly Encoding encoding = Encoding.UTF8; private static readonly EncryptionSettings _encryptionSettings; public static Encrypter(IOptions<EncryptionSettings> encryptionSettings) { _encryptionSettings = encryptionSettings.Value; } public static string Encrypt(string plainText) { (...) } public static string Decrypt(string plainText) { (...) } static byte HmacSHA256(String data) { (...) } } 'Encrypter.Encrypter(IOptions)': access modifiers are not allowed on static constructors 'Encrypter.Encrypter(IOptions)': a static constructor must be parameterless why is it a static cla...