diff --git a/Source/Meadow.Foundation.Libraries_and_Frameworks/Serialization.MicroJson/Driver/JsonPropertyName.cs b/Source/Meadow.Foundation.Libraries_and_Frameworks/Serialization.MicroJson/Driver/JsonPropertyNameAttribute.cs similarity index 85% rename from Source/Meadow.Foundation.Libraries_and_Frameworks/Serialization.MicroJson/Driver/JsonPropertyName.cs rename to Source/Meadow.Foundation.Libraries_and_Frameworks/Serialization.MicroJson/Driver/JsonPropertyNameAttribute.cs index f4af873ca..0bb5beedc 100644 --- a/Source/Meadow.Foundation.Libraries_and_Frameworks/Serialization.MicroJson/Driver/JsonPropertyName.cs +++ b/Source/Meadow.Foundation.Libraries_and_Frameworks/Serialization.MicroJson/Driver/JsonPropertyNameAttribute.cs @@ -6,7 +6,7 @@ namespace Meadow.Foundation.Serialization; /// Specifies the property name that is present in the JSON when serializing and deserializing. /// [AttributeUsage(AttributeTargets.Property, Inherited = true)] -public class JsonPropertyName : Attribute +public class JsonPropertyNameAttribute : Attribute { /// /// Gets the name of the property. @@ -17,7 +17,7 @@ public class JsonPropertyName : Attribute /// Initializes a new instance of JsonPropertyNameAttribute with the specified property name. /// /// The name of the property - public JsonPropertyName(string propertyName) + public JsonPropertyNameAttribute(string propertyName) { PropertyName = propertyName; } diff --git a/Source/Meadow.Foundation.Libraries_and_Frameworks/Serialization.MicroJson/Driver/MicroJson.TypeSafe.cs b/Source/Meadow.Foundation.Libraries_and_Frameworks/Serialization.MicroJson/Driver/MicroJson.TypeSafe.cs index 892ec43b7..83edd9978 100644 --- a/Source/Meadow.Foundation.Libraries_and_Frameworks/Serialization.MicroJson/Driver/MicroJson.TypeSafe.cs +++ b/Source/Meadow.Foundation.Libraries_and_Frameworks/Serialization.MicroJson/Driver/MicroJson.TypeSafe.cs @@ -225,7 +225,7 @@ private static void Deserialize(Hashtable? root, Type type, ref object instance) (PropertyInfo Property, string MappedTo)[] nameMap = props.Select((propertyInfo, index) => ( - propertyInfo.CustomAttributes.FirstOrDefault(a => a.AttributeType == typeof(JsonPropertyName)), + propertyInfo.CustomAttributes.FirstOrDefault(a => a.AttributeType == typeof(JsonPropertyNameAttribute)), props[index])) .Where(p => p.Item1 != null) .Select(t => (t.Item2, t.Item1.ConstructorArguments[0].Value.ToString())) diff --git a/Source/Meadow.Foundation.Libraries_and_Frameworks/Serialization.MicroJson/Driver/MicroJson.cs b/Source/Meadow.Foundation.Libraries_and_Frameworks/Serialization.MicroJson/Driver/MicroJson.cs index ea52714ba..59a27a529 100644 --- a/Source/Meadow.Foundation.Libraries_and_Frameworks/Serialization.MicroJson/Driver/MicroJson.cs +++ b/Source/Meadow.Foundation.Libraries_and_Frameworks/Serialization.MicroJson/Driver/MicroJson.cs @@ -171,7 +171,7 @@ public static string EscapeString(string value) { object returnObject = property.GetValue(o); - var mappedName = property.GetCustomAttribute(true); + var mappedName = property.GetCustomAttribute(true); var name = mappedName != null ? mappedName.PropertyName