I have classes that has properties serialized and saved in json in dynamodb
so it makes sense to use short names for these properties to save on dynamodb costs. Take for example the following class
[Serializable]
[DataContract]
public class UserState
{
[DataMember(Name = "tis")]
public HashSet<string> TableIds { get; set; }
[DataMember(Name = "wp")]
public Dictionary<string, int> PositionByTableId { get; set; }
[DataMember(Name = "ut")]
public DateTime UpdatedTime { get; set; }
}
We are also sending the serialized version of this class in a push notification to the frontend and would like to ignore short naming of properties when doing that.
Is there a way that we can serialize this class with short name properties for dynamodb and serialize with complete name properties for push notifications.
For dynamodb and push notifications both, we are using newtonsoft json serializer/deserializer.