Hello i have this message/class for example like this
[ProtoContract]
Public class UserMessage
{
public override DateTime MessageTimestamp { get; set; }
public override string MessageId { get; set; }
[ProtoMember(35)]
public string UserName { get; set; }
[ProtoMember(34)]
public string RealName { get; set; }
}
And then when i log messages or store them i dont want the RealName
to be stored or logged anywhere so i would want a function like
public UserMessage StripMessage(UserMessage msg){
//hide RealName from message
return msg;
}
so its very basic function but i just cant figure out how to do this. And i cant put like a [jsonignore]
or similar on the UserMessage
class since it comes from another soruce and should not be edited. So some way to scramble/hide fields in a message and return the unhidden ones