mirror of
https://github.com/tribufu/tribufu-dotnet
synced 2025-08-02 21:45:00 +00:00
Update BaseClassFirstContractResolver.cs
This commit is contained in:
@@ -14,7 +14,7 @@ namespace Tribufu.Serialization
|
|||||||
protected override IList<JsonProperty> CreateProperties(Type type, MemberSerialization memberSerialization)
|
protected override IList<JsonProperty> CreateProperties(Type type, MemberSerialization memberSerialization)
|
||||||
{
|
{
|
||||||
var props = base.CreateProperties(type, memberSerialization);
|
var props = base.CreateProperties(type, memberSerialization);
|
||||||
return props.OrderBy(p => !string.Equals(p.PropertyName, "id", StringComparison.OrdinalIgnoreCase)).ThenBy(p => p.DeclaringType != type).ToList();
|
return props.OrderBy(p => { return p.DeclaringType == type ? 1 : 0; }).ToList();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user