[Serializable]
public class Foo
{
private string bar;
public string Bar
{
get { return bar; }
set { bar = value; }
}
}
In the above code, Bar property is shown as it should be converted to autoproperty. The problem is that when the object is serializable, the internal variable name used for storage will be different from "bar", thus it will no longer de-serialize from storage or accross the network.
I think any object marked with either [Serializable] or [DataContract] should show a hint, not a suggestion for the conversion, otherwise it may lead to significant serialization problems.
Description
[Serializable]
public class Foo
{
private string bar;
public string Bar
{
get { return bar; }
set { bar = value; }
}
}
In the above code, Bar property is shown as it should be converted to autoproperty. The problem is that when the object is serializable, the internal variable name used for storage will be different from "bar", thus it will no longer de-serialize from storage or accross the network.
I think any object marked with either [Serializable] or [DataContract] should show a hint, not a suggestion for the conversion, otherwise it may lead to significant serialization problems.