From ef72f8f3fe5a4399423d921edd1c182d663201aa Mon Sep 17 00:00:00 2001 From: ivarlovlie Date: Wed, 31 Mar 2021 19:20:06 +0200 Subject: Only store value in variable, when needing it more than ones (in DEBUG) --- src/IOL.VippsEcommerce.Client/Program.cs | 2 ++ 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(); 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 } } } -- cgit v1.3