Skip to content

Commit 20019bf

Browse files
committed
Merge branch 'system.text.json' of https://github.com/riganti/dotvvm into system.text.json
2 parents 91e03b6 + 32bafde commit 20019bf

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/Framework/Framework/ViewModel/Serialization/ViewModelSerializationMapper.cs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ protected virtual MemberInfo[] ResolveShadowing(Type type, MemberInfo[] members)
162162
protected virtual IEnumerable<ViewModelPropertyMap> GetProperties(Type type, MethodBase? constructor)
163163
{
164164
var ctorParams = constructor?.GetParameters().ToDictionary(p => p.Name.NotNull(), StringComparer.OrdinalIgnoreCase);
165-
165+
166166
var properties = type.GetAllMembers(BindingFlags.Public | BindingFlags.Instance)
167167
.Where(m => m is PropertyInfo or FieldInfo)
168168
.ToArray();
@@ -175,10 +175,11 @@ protected virtual IEnumerable<ViewModelPropertyMap> GetProperties(Type type, Met
175175
if (property is FieldInfo)
176176
{
177177
// fields are ignored by default, unless marked with [Bind(not None)], [JsonInclude] or defined in ValueTuple<...>
178-
include = include ||
178+
include = include && (
179179
!(bindAttribute is null or { Direction: Direction.None }) ||
180180
property.IsDefined(typeof(JsonIncludeAttribute)) ||
181-
(type.IsGenericType && type.FullName!.StartsWith("System.ValueTuple`"));
181+
(type.IsGenericType && type.FullName!.StartsWith("System.ValueTuple`"))
182+
);
182183
}
183184
if (!include) continue;
184185

0 commit comments

Comments
 (0)