title: Inconsistent Accessibility Problem in .NET
body: <p>I am creating a Three-Tier Architecture Demo .NET Project. While I was creating my layers, I was faced with that error.</p>
  <p><strong>Severity  Code    Description Project File    Line    Suppression State
  Error   CS0060  Inconsistent accessibility: base class 'EfEntityRepositoryBase&lt;Product, NorthwindContext&gt;' is less accessible than class 'EfProductDal' DataAccess  C:\Users\90553\source\repos\kodlamaio_bootcamp\MyFinalProject\DataAccess\Concrete\EntityFramework\EfProductDal.cs   13  Active</strong></p>
  <p><strong>EfProductDal.cs:</strong></p>
  <pre><code>using Core.DataAccess.EntityFramework;
  using DataAccess.Abstract;
  using Entities.Concrete;
  
  
  namespace DataAccess.Concrete.EntityFramework
  {
      public class EfProductDal : EfEntityRepositoryBase&lt;Product, NorthwindContext&gt;, IProductDal
      {
          
      }
  }
  </code></pre>
  <p><strong>EfEntityRepositoryBase.cs:</strong></p>
  <pre><code>using Core.Entities;
  using Microsoft.EntityFrameworkCore;
  using System;
  using System.Collections.Generic;
  using System.Linq;
  using System.Linq.Expressions;
  using System.Text;
  using System.Threading.Tasks;
  
  namespace Core.DataAccess.EntityFramework
  {
      public class EfEntityRepositoryBase&lt;TEntity, TContext&gt; : IEntityRepository&lt;TEntity&gt;
          // Give constraints
          where TEntity : class, IEntity, new()
          where TContext : DbContext, new()
      {
          public void Add(TEntity entity)
          {
              // IDisposable pattern implementation of c#
              // if program done with NorthwindContext, context is collected by garbage collector 
              using (TContext context = new TContext())
              {
                  // create relation between references
                  var addedEntity = context.Entry(entity);
                  addedEntity.State = EntityState.Added;
                  context.SaveChanges();
              }
          }
  
          public void Delete(TEntity entity)
          {
              using (TContext context = new TContext())
              {
                  // create relation between references
                  var deletedEntity = context.Entry(entity);
                  deletedEntity.State = EntityState.Deleted;
                  context.SaveChanges();
              }
          }
  
          public TEntity Get(Expression&lt;Func&lt;TEntity, bool&gt;&gt; filter)
          {
              using (TContext context = new TContext())
              {
                  return context.Set&lt;TEntity&gt;().SingleOrDefault(filter);
              }
          }
  
  
          public List&lt;TEntity&gt; GetAll(Expression&lt;Func&lt;TEntity, bool&gt;&gt; filter = null)
          {
              using (TContext context = new TContext())
              {
                  return filter == null
                      ? context.Set&lt;TEntity&gt;().ToList()
                      : context.Set&lt;TEntity&gt;().Where(filter).ToList();
              }
  
          }
  
          public void Update(TEntity entity)
          {
              using (TContext context = new TContext())
              {
                  var updatedEntity = context.Entry(entity);
                  updatedEntity.State = EntityState.Modified;
                  context.SaveChanges();
              }
          }
      }
  }
  </code></pre>
  <p><strong>IEntityRepository.cs:</strong></p>
  <pre><code>using Core.Entities;
  using System;
  using System.Collections.Generic;
  using System.Linq;
  using System.Linq.Expressions;
  using System.Text;
  using System.Threading.Tasks;
  
  namespace Core.DataAccess
  {
      // Generic Constraint
      // class: reference type
      // IEntity: It can be IEntity or any object that implements IEntity
      // new(): must be object that can used with new
      public interface IEntityRepository&lt;T&gt; where T:class,IEntity,new()
      {
  
          List&lt;T&gt; GetAll(Expression&lt;Func&lt;T,bool&gt;&gt; filter=null);
  
          T Get(Expression&lt;Func&lt;T,bool&gt;&gt; filter);
          void Add(T entity);
  
          void Update(T entity);
  
          void Delete(T entity);
  
      }
  }
  </code></pre>
  <p>Solution Explorer Image:</p>
  <p><a href="https://i.stack.imgur.com/7Nd6C.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/7Nd6C.png" alt="Solution Explorer Image" /></a></p>
  <p>Despite all my classes being public why visual studio gives an error about less accessibility. Any Help?</p>