c# - Inconsistent Accessibility -
i have taken simple interface
public interface ibinaryhelper { tobinary converttobinary(string pathbinary); }
i trying access in class below it
public class apihelper : ibinaryhelper { private readonly restclient _client; public tobinary converttobinary(string pathbinary) { tobinary binary = null; var request = new restrequest("sampleapi/converttobinary/{pathbinary}", method.get) { requestformat = dataformat.json }; request.addparameter("pathbinary", pathbinary, parametertype.urlsegment); var response = _client.execute<tobinary>(request); binary = response.data; return binary; } }
now when build it, error getting error inconsisten accessibility:
return type
apihelper.tobinary
less accessible methodapihelper.apihelper.converttobinary(string)
@converttobinary
method both in interface , in class
you returning object of type tobinary
public method on public class.
the tobinary
class needs visible possible callers of apihelper.converttobinary
method - therefore, should public well.
Comments
Post a Comment