aboutsummaryrefslogtreecommitdiffstats
path: root/src/IOL.VippsEcommerce/Models
diff options
context:
space:
mode:
authorivarlovlie <git@ivarlovlie.no>2021-03-31 19:20:06 +0200
committerivarlovlie <git@ivarlovlie.no>2021-03-31 19:20:06 +0200
commitef72f8f3fe5a4399423d921edd1c182d663201aa (patch)
tree26412e62451bb0eeb0d7bb5e84d54480bdcd0900 /src/IOL.VippsEcommerce/Models
parentb2a3877a45241dbce595f3c31ec59bd7f8c1e692 (diff)
downloaddotnet-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/IOL.VippsEcommerce/Models')
-rw-r--r--src/IOL.VippsEcommerce/Models/VippsConfiguration.cs6
1 files changed, 4 insertions, 2 deletions
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
}
}
}