I have a code downloaded from AWS for Signature Version 4. Their code goes like this:
public class PresignedUrl
{
public static void Run(string a, string b, string c)
{
}
}
I want to apply dependency injection in order for me to use the configuration service which was registered as singleton. So it would turn out to be something like this:
using MyNamespace.Services.Interfaces;
public class PresignedUrl
{
private static string _awsAccessKeyID;
private static string _awsSecretKey;
public PresignedUrl(IMyConfigurationService config)
{
_awsAccessKeyID = config.AWSAccessKeyID;
_awsSecretKey = config.AWSSecretKey;
}
public static void Run(string a, string b, string c)
{
}
}
But the issue is there's no value inside config.AWSAccessKeyID and config.AWSSecretKey. But in other non-static method it has. When I debug it, the 2 mentioned variable are null.
How can I fixed it?