I have a property that looks like this
private int clientID;
public int ClientID
{
get { return clientID; }
set { clientID = value; }
}
I would like to be able to pass in a string to this property so that the setter will convert it for me. How do I do that?
I know how to do the conversion, I just need to know how to pass in a string without it throwing a type error.
Thanks,
Tom
You can't, basically. Options:
SetClientID(string)
)object
and do different things based on the value passed in (urgh - please don't do 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