c# - What to pass as string argument to constructor? -
i have following situation:
protected mobilewalletrequestbase(xmldocument xmldoc, string request) { _xmldoc = xmldoc; } protected mobilewalletrequestbase() : this(new xmldocument(), ?) { _xmldoc.loadxml("<?xml version=\"1.0\" encoding=\"utf-8\"?><request/>"); }
what should write in second constructor in order pass string value?
one approach use default argument:
protected mobilewalletrequestbase(xmldocument xmldoc, string request="foo") { // you're not using request in here, unclear what's needed _xmldoc = xmldoc; } protected mobilewalletrequestbase() : this(new xmldocument()) // don't { _xmldoc.loadxml("<?xml version=\"1.0\" encoding=\"utf-8\"?><request/>"); }
Comments
Post a Comment