I'm a Java Developer, used to the 'generate toString()' option in Eclipse which offers a complete toString, printing values of all instance variables. I'm just looking for the comparable shortcut in Visual Studio.
I've seen how you can begin typing the method, "public override " and autocomplete will stub a ToString() but it will not fill it in with all the class properties.
public override string ToString()
{
return base.ToString();
}
I'd like the generated method to include all properties of the class.
You could use JSON.NET to serialize your class.
public override string ToString()
{
return JsonConvert.SerializeObject(this);
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With