I have a class that interacts with the API and needs to do some transformations for any data that it affects. This class is also equivalent:
public class SerializeMe
{
public SerializeMe(string someString)
{
_someString = someString;
}
private string _someString;
public string TransformedValue
{
get { _someString = TransformToSomething();
return _someString; }
set { _someString = value; }
}
}
For my API users, I log each request and response by serializing these classes. They act like xml schemes almost.
Now everything works fine, my only problem is that someone could theoretically try to install and not return the expected results. This is mainly a design issue that is simply trying to make my code accountable. I would like to be able to use a private set, but the XmlSerializer complains about this.
- , Transformed unsettable, ?
, , . ?