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

Popular posts from this blog

android - Get AccessToken using signpost OAuth without opening a browser (Two legged Oauth) -

org.mockito.exceptions.misusing.InvalidUseOfMatchersException: mockito -

google shop client API returns 400 bad request error while adding an item -