Base solution for your next web application
Open Closed

set AppAuthorizationProvider permissions from database. #6862


User avatar
0
samara081 created

We need to dynamically read permissions from database, we have injected the table repository object, however we called GetAll method inside AppAuthorizationProvider.SetPermissions we get the following error: System.ObjectDisposedException “Cannot access a disposed object. A common cause of this error is disposing a context that was resolved from dependency injection and then later trying to use the same context instance elsewhere in your application. This may occur if you are calling Dispose() on the context, or wrapping the context in a using statement. If you are using dependency injection, you should let the dependency injection container take care of disposing context instances. Object name: 'VdpDbContext'.


2 Answer(s)
  • User Avatar
    0
    aaron created
    Support Team

    Mark the method as [UnitOfWork] or begin a unit of work using IUnitOfWorkManager. https://aspnetboilerplate.com/Pages/Documents/Unit-Of-Work

  • User Avatar
    0
    samara081 created

    Thanks Aaron, this solved the issue