Skip to content

..BuilderExtension methods are called as ...BuilderExtensions.Method() instead of .Method() in migrations #1990

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
lauxjpn opened this issue Mar 10, 2025 · 0 comments

Comments

@lauxjpn
Copy link
Collaborator

lauxjpn commented Mar 10, 2025

Currently, extension methods are called in migrations as in the following example:

modelBuilder.Entity("IssueConsoleTemplate.IceCream", b =>
    {
        b.Property<int>("IceCreamId")
            .ValueGeneratedOnAdd()
            .HasColumnType("int");

        MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<int>("IceCreamId"));

        b.Property<string>("Name")
            .HasColumnType("longtext");

        MySqlPropertyBuilderExtensions.HasCharSet(b.Property<string>("Name"), "latin1");
    }):

A better representation would be the following one (which I believe has worked in some earlier release trains):

modelBuilder.Entity("IssueConsoleTemplate.IceCream", b =>
    {
        b.Property<int>("IceCreamId")
            .ValueGeneratedOnAdd()
            .HasColumnType("int")
            .UseMySqlIdentityColumn("IceCreamId");

        b.Property<string>("Name")
            .HasColumnType("longtext")
            .HasCharSet("latin1");
    }):

Technical details (please complete the following information):

  • Pomelo.EntityFrameworkCore.MySql version: at least in 9.0 (need to check other release trains)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant