mvcarchitecture icon indicating copy to clipboard operation
mvcarchitecture copied to clipboard

Error CS0122 'Disposable.Disposable()' is inaccessible due to its protection level

Open LaoTech opened this issue 7 years ago • 0 comments

Hello, I got the follow error "Error CS0122 'Disposable.Disposable()' is inaccessible due to its protection level" when I tried to implement DbFactory class. Please see below for details. It's also happening the code project download. Please advise.

Thanks,

Mani

public class DbFactory : Disposable, IDbFactory { StoreEntities dbContext;

    public StoreEntities Init()
    {
        return dbContext ?? (dbContext = new StoreEntities());

    }

    protected override void DisposeCore()
    {
        if(dbContext != null)
        {
            dbContext.Dispose();
        }
    }
}

LaoTech avatar Sep 25 '17 20:09 LaoTech