c# - not able to access functions of a different class in different namespace -
i have 2 different namespaces
namespace 1
namespace project.constants { public class educationalinstitutes { public string test() { return "value"; } } }
namespace 2
using project.constants; //namespace 1 namespace project.dal { public class educationalinstitute { educationalinstitutes obj = new educationalinstitutes(); obj. } }
the problem functions have defined in class educationalinstitutes
not available in place have created object
you need place code in bottom snippet inside method.
you can't call methods on obj
location in class.
public class educationalinstitute { educationalinstitutes obj = new educationalinstitutes(); public void dosomething() { obj.test(); } }
Comments
Post a Comment