I’ve a class similar to one below:
namespace BLL {
public partial class SomeClass
{
public void Save(string xmlFile){
//Body
}
public static Person Parse(string xml)
{
//Body
}
}
}
Problem:
I can call Save method by creating an instance of SomeClass. However I can’t access the Parse method from instance of SomeClass. I also tried SomeClass.Parse, still no luck.
If I do BLL.SomeClass.Parse then I can only access that Parase Method.
Could anyone please help me out what’s happening on above scenario? Is it only possible to access static method from namaspace.class.methodname?
Thanks.
Assuming you have the namespace in a using, you should be able to do SomeClass.Parse. Otherwise you have to do BLL.SomeClass.Parse. And it is not possible to call static functions from an instance object.