I have data stored in a database with short field names to save space. When I load these into my .NET Core app, I convert the data to its C# model. Then, when I pass this to the fronted I want to serialize the JSON to have full field names. So instead of "fN", "firstName".
I know I can use [JsonProperty(PropertyName = "SomeName")]
to change serialization/deserialization. What I'm asking is whether there's a way to specify multiple property names for a single field, ideally with some additional "profile" variable so that when I serialize/deserialize from the DB I use the DB profile, and when sending to the client I use the other profile. This way I can either use the short or long names when convenient.
Thanks!
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…