Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

First time with this error - Inconsistent accessibility

This is my first time working with interfaces and proper namespace structure. When I compile I get the error below, I have no idea what it means. Any searches I do shows up private public issues but both are public. Any ideas?

Error Inconsistent accessibility: return type 'System.Collections.Generic.List' is less accessible than method 'Webtext.ApplicationEntities.Implementations.AdditionalEntities.UrlBuilderO2.GetUrlRequests (string, string, string, string)' C:\Users\Laptop\documents\visual studio 2010\Projects\Webtext\Webtext\ApplicationEntities\Implementations\AdditionalEntities\UrlBuilderO2.cs 19 39 Webtext

The Code files are:

namespace Webtext.ApplicationEntities.Interfaces
{
    interface IUrlBuilder
    {
       List<IOperatorRequest> GetUrlRequests(string UserName, string Password, string MessageRecipient, string Message);
    }
}

And:

namespace Webtext.ApplicationEntities.Implementations.AdditionalEntities
{
    public class UrlBuilderO2: IUrlBuilder
    {

        public List<IOperatorRequest> GetUrlRequests(string UserName, string Password, string MessageRecipient, string Message)
        {
            throw new NotImplementedException();
        }
    }
}

Namespace Structure

Webtext

ApplicationEntities

     Interfaces
          ##### INTERFACE IS HERE

     Implementations

          AdditionalEntities
               ##### URL BUILDER IS HERE
like image 771
deanvmc Avatar asked Sep 09 '26 19:09

deanvmc


1 Answers

You have a public property on a public class that exposes a list of non-public types.
You need to change IOperatorRequest to be public or change the UrlBuilderO2 class or GetUrlReuests method to be non-public.

like image 195
SLaks Avatar answered Sep 12 '26 07:09

SLaks



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!