Open Closed

Issue with seed method after package update and multitenancy #183


0
apexdodge created

Hi there, I upgraded my package and I'm having difficulty with my seed method after running Update-Database

"Can not set TenantId to a different value from the current filter parameter value while MayHaveTenant filter is enabled!"

My Seed Method is to populate the database with some basic data while I build my application.

Take note that I'm not using UnitOfWork manager here in seed method. Do I have to now? Perhaps I'm not using the best practice for Seed Method with ABP?

<a class="postlink" href="http://i.imgur.com/Z5KZ8Dx.png">http://i.imgur.com/Z5KZ8Dx.png</a>

Thanks


3 Answer(s)
  • 0
    hikalkan created
    Support Team

    Use DisableAllFilters for your DbContext in your seed method. Example:

    <a class="postlink" href="https://github.com/aspnetboilerplate/module-zero-template/blob/master/src/AbpCompanyName.AbpProjectName.EntityFramework/Migrations/Configuration.cs">https://github.com/aspnetboilerplate/mo ... uration.cs</a>

  • 0
    apexdodge created

    You're the best, thanks so much

  • 0
    hikalkan created
    Support Team

    :) thank you too.