-Fixed (hopefully) MetadataTypeAttribute not being found on some platforms
This commit is contained in:
@@ -240,8 +240,9 @@ namespace Newtonsoft.Json.Serialization
|
|||||||
{
|
{
|
||||||
Type attributeType = attribute.GetType();
|
Type attributeType = attribute.GetType();
|
||||||
|
|
||||||
if (string.Equals(attributeType.Name, "MetadataTypeAttribute", StringComparison.Ordinal)
|
// only test on attribute type name
|
||||||
&& attributeType.Assembly().FullName.StartsWith("System.ComponentModel.DataAnnotations", StringComparison.Ordinal))
|
// attribute assembly could change because of type forwarding, etc
|
||||||
|
if (string.Equals(attributeType.FullName, "System.ComponentModel.DataAnnotations.MetadataTypeAttribute", StringComparison.Ordinal))
|
||||||
{
|
{
|
||||||
const string metadataClassTypeName = "MetadataClassType";
|
const string metadataClassTypeName = "MetadataClassType";
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user