I have a class, in which I want to create an instance of an XDocument. In the constructor I need to call the "Load" method, but for some reason it is not available to call.
For example:
class MyClass
{
private XDocument xmlResponse;
public MyClass(string url)
{
xmlResponse.Load(url);
}
}
I get the error "cannot be accessed with an instance reference; qualify it with a type name instead"
So I tried "MyClass.xmlResponse.Load(url)" but I'm getting the same error.
What is the proper way of calling the method?