diff options
| author | ivarlovlie <git@ivarlovlie.no> | 2021-03-31 19:20:06 +0200 |
|---|---|---|
| committer | ivarlovlie <git@ivarlovlie.no> | 2021-03-31 19:20:06 +0200 |
| commit | ef72f8f3fe5a4399423d921edd1c182d663201aa (patch) | |
| tree | 26412e62451bb0eeb0d7bb5e84d54480bdcd0900 /src | |
| parent | b2a3877a45241dbce595f3c31ec59bd7f8c1e692 (diff) | |
| download | dotnet-vipps-ecommerce-ef72f8f3fe5a4399423d921edd1c182d663201aa.tar.xz dotnet-vipps-ecommerce-ef72f8f3fe5a4399423d921edd1c182d663201aa.zip | |
Only store value in variable, when needing it more than ones (in DEBUG)
Diffstat (limited to 'src')
| -rw-r--r-- | src/IOL.VippsEcommerce.Client/Program.cs | 2 | ||||
| -rw-r--r-- | src/IOL.VippsEcommerce/Models/VippsConfiguration.cs | 6 |
2 files changed, 6 insertions, 2 deletions
diff --git a/src/IOL.VippsEcommerce.Client/Program.cs b/src/IOL.VippsEcommerce.Client/Program.cs index a4faccc..839edfe 100644 --- a/src/IOL.VippsEcommerce.Client/Program.cs +++ b/src/IOL.VippsEcommerce.Client/Program.cs @@ -9,6 +9,8 @@ services.AddVippsEcommerceService(o => { o.PrimarySubscriptionKey = ""; o.ClientSecret = ""; o.ClientId = ""; + o.CacheEncryptionKey = ""; + o.CredentialsCacheFilePath = ""; }); var provider = services.BuildServiceProvider(); var vippsEcommerceService = provider.GetService<IVippsEcommerceService>(); diff --git a/src/IOL.VippsEcommerce/Models/VippsConfiguration.cs b/src/IOL.VippsEcommerce/Models/VippsConfiguration.cs index 5411ebc..252c877 100644 --- a/src/IOL.VippsEcommerce/Models/VippsConfiguration.cs +++ b/src/IOL.VippsEcommerce/Models/VippsConfiguration.cs @@ -114,11 +114,13 @@ namespace IOL.VippsEcommerce.Models foreach (var attribute in prop.CustomAttributes) { foreach (var argument in attribute.ConstructorArguments) { if (argument.Value as string == key) { - var value = prop.GetValue(this, null)?.ToString(); #if DEBUG + var value = prop.GetValue(this, null)?.ToString(); Console.WriteLine("Key: " + key + " Value: " + value); -#endif return value; +#else + return prop.GetValue(this, null)?.ToString(); +#endif } } } |
