Skip to content

Commit

Permalink
fix: json serialization for .net8
Browse files Browse the repository at this point in the history
BREAKING CHANGE: .Net 8
  • Loading branch information
github-actions committed Oct 19, 2023
1 parent b4efe06 commit f372f15
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/Aguacongas.AspNetCore.Authentication/ContractResolver.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,14 @@ protected override JsonProperty CreateProperty(MemberInfo member, MemberSerializ
var property = base.CreateProperty(member, memberSerialization);
var propertyInfo = member as PropertyInfo;
var propertyType = propertyInfo?.PropertyType;
property.ShouldSerialize = instance => propertyType != null &&
(!propertyType.IsInterface ||
property.ShouldSerialize = instance => propertyType != null &&
(!propertyType.IsInterface ||
(typeof(IEnumerable).IsAssignableFrom(propertyType) &&
propertyType.IsGenericType
&& propertyType.GetGenericArguments().Any(a => !a.IsInterface)))
propertyType.IsGenericType
&& propertyType.GetGenericArguments().Any(a => !a.IsInterface && !a.IsAbstract)))
&& !propertyType.IsSubclassOf(typeof(Delegate));

return property;
}
}
}
}

0 comments on commit f372f15

Please sign in to comment.