Base solution for your next web application
Open Closed

Upgrade to 4.1/ EF Core Issue #3477


User avatar
0
jonas452 created

Hi,

I've tried to upgrade to 4.1 with mixed succes. After digging around i discovered that the latest version of EFCore does not support TPH(Table per heneritance). Wich is a problem for me cause i use that quite often in my database design.

So I'm thinking why not just roll back to EF6. But how do i best tackle that? Let's say i download a blank ASPNet Zero solution V4.1.

How would you guys change the EntityFrameworkCore project to EF6?

Thx for you advice.


4 Answer(s)
  • User Avatar
    0
    ismcagdas created
    Support Team

    Hi,

    If you look at here <a class="postlink" href="https://github.com/aspnet/EntityFramework/wiki/Roadmap#ef-core-10-released">https://github.com/aspnet/EntityFramewo ... 0-released</a>, TPH is supported but maybe you have a special need.

    We have made below changes in DB when moving to EF Core. So, after removing EF Core references and adding back to EF 6.x references, then you can revert below changes in your DB.

    New Tables AbpRoleClaims AbpUserTokens __EFMigrationsHistory

    Changed Tables AbpUsers NormalizedEmailAddress: UPPER case of EmailAddress. NormalizedUserName: UPPER case of UserName. ConcurrencyStamp AbpRoles NormalizedName: UPPER case of Name. ConcurrencyStamp

    Deleted Tables __MigrationHistory

    Thanks.

  • User Avatar
    0
    jonas452 created

    Yeah, i don't know why i said TPH but i mean TPT. Anyway Thx for the tip. I'll try your suggestion.

  • User Avatar
    0
    jonas452 created

    Hey,

    It's not that easy it seems. How do i handle the JobByteDbContextConfigurer?

    As you can see i changed the references in the project but i feel like that cant be enough.

    Any tips would be much appreciated.

  • User Avatar
    0
    ismcagdas created
    Support Team

    Hi,

    For EF 6 it is different. You need to use a configuration class like this <a class="postlink" href="https://github.com/aspnetzero/aspnet-zero/blob/dev/src/MyCompanyName.AbpZeroTemplate.EntityFramework/Migrations/Configuration.cs">https://github.com/aspnetzero/aspnet-ze ... uration.cs</a>.

    You can check our github repository for this.

    Thanks.