I have a complex object type for which I'm overriding the "base.ToString()" method so that it returns a string property value.
for example:
class foo
{
public string StringValue{get;set;}
public int SomeOtherValue{ get;set;}
public override ToString()
{
return StringValue;
}
}
So this allows me to use retrieve the value of the StringValue property easily.
Is there a way in which I can override or extend the base functionality so that I can use simple code such as below to set the StringValue
property?
foo aFoo = new foo();
aFoo = "Some string value";