Inconsistent accessibility error in MVC

I had a fairly simple scenario involving MVC and EF. I was implementing an interface like so:

    public class EntityDetailRepository : EntityRepository<EntityDetail>, IEntityDetailRepository {
  public EntityDetailRepository()
   : base() {
  }

However, for my troubles, I was getting this error:

Inconsistent accessibility: base interface ‘Yada.IEntityRepository<EntityDetail>’ is less accessible than interface ‘Yada.IEntityDetailRepository’

The interfaces were declared “public”, so the compiler was obviously deranged, and close to going all HAL on me. Luckily, before it could do that, I discovered that the underlying type, EntityDetail, was not:

    class EntityDetail {
        public int ID { get; set; }
    }

See, no “public”. After I made the type public, all was well:

    public class EntityDetail {
        public int ID { get; set; }
    }
Advertisements

,

  1. Leave a comment

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: