Skip to content

Commit

Permalink
Merge pull request #28 from essensoft/dev
Browse files Browse the repository at this point in the history
2.4.1
  • Loading branch information
Roc committed Jun 28, 2019
2 parents 9f24c30 + f235fc5 commit 2c5846a
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 8 deletions.
2 changes: 1 addition & 1 deletion common.props
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project>
<PropertyGroup>
<Version>2.4.0</Version>
<Version>2.4.1</Version>
<NoWarn>$(NoWarn);CS1570;CS1591</NoWarn>
<Description>Essensoft.AspNetCore.Payment</Description>
<Copyright>© Essensoft 2019</Copyright>
Expand Down
2 changes: 1 addition & 1 deletion samples/WebApplicationSample/Views/Shared/_Layout.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<body>
<nav class="navbar navbar-expand-lg navbar-light bg-white navbar-shadow">
<div class="container">
<a asp-controller="Home" asp-action="Index" class="navbar-brand"><img src="~/images/Payment-Title.png" /></a>
<a asp-controller="Home" asp-action="Index" class="navbar-brand"><img src="~/images/payment.png" /></a>
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbar" aria-controls="navbar" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,11 @@ public List<T> Parse<T>(QPayDictionary dictionary) where T : new()
foreach (var field in properties)
{
var name = $"{GetKeyName(field)}_{i}";
field.SetValue(item, Convert.ChangeType(dictionary.GetValue(name), field.PropertyType));
var value = dictionary.GetValue(name);
if (!string.IsNullOrEmpty(value))
{
field.SetValue(item, Convert.ChangeType(value, field.PropertyType));
}
}
list.Add(item);
}
Expand Down Expand Up @@ -54,7 +58,11 @@ public List<T> Parse<T>(QPayDictionary dictionary) where T : new()
foreach (var subfield in subProperties)
{
var name = $"{GetKeyName(subfield)}_{i}_{j}";
subfield.SetValue(item, Convert.ChangeType(dictionary.GetValue(name), subfield.PropertyType));
var value = dictionary.GetValue(name);
if (!string.IsNullOrEmpty(value))
{
subfield.SetValue(item, Convert.ChangeType(value, subfield.PropertyType));
}
}
sublist.Add(subItem);
}
Expand All @@ -63,7 +71,11 @@ public List<T> Parse<T>(QPayDictionary dictionary) where T : new()
else
{
var name = $"{GetKeyName(field)}_{i}";
field.SetValue(item, Convert.ChangeType(dictionary.GetValue(name), field.PropertyType));
var value = dictionary.GetValue(name);
if (!string.IsNullOrEmpty(value))
{
field.SetValue(item, Convert.ChangeType(value, field.PropertyType));
}
}
}
list.Add(item);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,11 @@ public List<T> Parse<T>(WeChatPayDictionary dictionary) where T : new()
foreach (var field in properties)
{
var name = $"{GetKeyName(field)}_{i}";
field.SetValue(item, Convert.ChangeType(dictionary.GetValue(name), field.PropertyType));
var value = dictionary.GetValue(name);
if (!string.IsNullOrEmpty(value))
{
field.SetValue(item, Convert.ChangeType(value, field.PropertyType));
}
}
list.Add(item);
}
Expand Down Expand Up @@ -54,7 +58,11 @@ public List<T> Parse<T>(WeChatPayDictionary dictionary) where T : new()
foreach (var subfield in subProperties)
{
var name = $"{GetKeyName(subfield)}_{i}_{j}";
subfield.SetValue(item, Convert.ChangeType(dictionary.GetValue(name), subfield.PropertyType));
var value = dictionary.GetValue(name);
if (!string.IsNullOrEmpty(value))
{
subfield.SetValue(item, Convert.ChangeType(value, subfield.PropertyType));
}
}
sublist.Add(subItem);
}
Expand All @@ -63,7 +71,11 @@ public List<T> Parse<T>(WeChatPayDictionary dictionary) where T : new()
else
{
var name = $"{GetKeyName(field)}_{i}";
field.SetValue(item, Convert.ChangeType(dictionary.GetValue(name), field.PropertyType));
var value = dictionary.GetValue(name);
if (!string.IsNullOrEmpty(value))
{
field.SetValue(item, Convert.ChangeType(value, field.PropertyType));
}
}
}
list.Add(item);
Expand Down

0 comments on commit 2c5846a

Please sign in to comment.