Skip to content

Fix migrations outputting static method calls instead of fluent chaining#2027

Open
kimjaejung96 wants to merge 1 commit intoPomeloFoundation:mainfrom
kimjaejung96:kimjaejung96/migrations-fluent-api(#1990)
Open

Fix migrations outputting static method calls instead of fluent chaining#2027
kimjaejung96 wants to merge 1 commit intoPomeloFoundation:mainfrom
kimjaejung96:kimjaejung96/migrations-fluent-api(#1990)

Conversation

@kimjaejung96
Copy link

Use method name strings instead of MethodInfo for MethodCallCodeFragment construction. This ensures EF Core's CSharpSnapshotGenerator outputs fluent chaining (e.g., .HasCharSet("latin1")) instead of static method calls (e.g., MySqlPropertyBuilderExtensions.HasCharSet(...)).

Add unit tests to verify MethodInfo is null for fluent API fragments.

Fixes #1990

Use method name strings instead of MethodInfo for MethodCallCodeFragment
construction. This ensures EF Core's CSharpSnapshotGenerator outputs
fluent chaining (e.g., .HasCharSet("latin1")) instead of static method
calls (e.g., MySqlPropertyBuilderExtensions.HasCharSet(...)).

Add unit tests to verify MethodInfo is null for fluent API fragments.

Fixes PomeloFoundation#1990
@kimjaejung96
Copy link
Author

kimjaejung96 commented Jan 10, 2026

Hi! @lauxjpn I’ve opened PR #2027 to address #1990. :)
The change makes EF Core generate fluent chaining by using method name strings for MethodCallCodeFragment, and includes tests verifying MethodInfo is null for the relevant fragments.

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

Successfully merging this pull request may close these issues.

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

1 participant