Ability to change the serialized property name
See original GitHub issueWe should have the ability to change the serialized property name when serializing and saving to mongodb; similar to the the way we are able to change the name of the class object. for example:
[Name("employee")]
public class EmployeeEntity : Entity {
[Name("fname")]
public string FirstName { get; set; }
[Name("lname")]
public string LastName { get; set; }
}
Should be serialized to:
{
"_id": { "$oid": "60b36d297e3d155fe85a4b84" },
"fname": "aaa",
"lname": "bbb"
}
Or by default, when serializing to json, all properties are converted to lowercase
Issue Analytics
- State:
- Created 2 years ago
- Comments:7 (7 by maintainers)
Top Results From Across the Web
Changing the name of the SerializedProperty (breaks ...
This is quite an issue if already having a bunch of values serialized (saved with project) with another name.
Read more >c# - How can I change property names when serializing ...
json file. I would like to change the property names to be something different (say, change 'foo' to 'bar'). In the Json.net documentation, ......
Read more >SerializedProperty.name - Scripting API
SerializedProperty.name. Leave feedback. Suggest a change ... Submit suggestion. Cancel. public string name;. Description. Name of the property. (Read Only) ...
Read more >Scripting API: SerializedProperty
SerializedProperty is primarily used to read or change the value of a property. It can also iterate through the properties of an object...
Read more >How to customize property names and values with System. ...
To set the name of individual properties, use the [JsonPropertyName] attribute. Here's an example type to serialize and resulting JSON:.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
i only really use BsonElementAttribute, but the naming is so off as compared to how the naming goes in mongodb-entities that i just had to request it
yeah i could add an attribute called
[Field("FieldName")]
. sounds good? because we can’t use the same[Name(...)]
attribute for both purposes.