What is wrong with this?:
public abstract class EFNLBaseRepository:IDisposable
{
NLSubscriberDBContext _dbContext;
protected internal NLSubscriberDBContext dbContext
{
get
{...}
}
...
}
internal class NLSubscriberDBContext : DbContext
{
...
}
Of course, both classes are on the same assembly.
This is the compilation error I’m getting:
Error 1 Inconsistent accessibility: property type
‘NLSubscriber.Core.Service.Repository.EFDAL.NLSubscriberDBContext’ is
less accessible than property
‘NLSubscriber.Core.Service.Repository.EFDAL.EFNLBaseRepository.dbContext’ C:\Data\Projects\Neticon\TFS\NLSubscriber
– Newsletter\NLSubscriber-newsletter\NLSubscriber.Core\Service\Repository\EFDAL\EFNLBaseRepository.cs 12 50 NLSubscriber.Core
protected internalgives all subclasses access to the property, even when the subclass is outside the DLL. This is inconsistent with the type of the property beinginternal, because it would require a subclass from the outside to have access to the internal type.Consider this example: I subclass
EFNLBaseRepositoryfrom outside your DLL