Skip to content
This repository was archived by the owner on May 25, 2026. It is now read-only.

fix(worker): add EFCore.NamingConventions and UseSnakeCase - #7

Merged
cherninkiy merged 1 commit into
mainfrom
dev
May 12, 2026
Merged

fix(worker): add EFCore.NamingConventions and UseSnakeCase#7
cherninkiy merged 1 commit into
mainfrom
dev

Conversation

@cherninkiy

Copy link
Copy Markdown
Owner
  • add UseSnakeCaseNamingConvention in Worker Program.cs (EF Core generates PascalCase columns, DB has snake_case fixes column p.MessageId does not exist error)
  • add EFCore.NamingConventions 8.0.3 package reference
  • pin version 8.0.3 (not wildcard 8.0.*)

- add UseSnakeCaseNamingConvention in Worker Program.cs
  (EF Core generates PascalCase columns, DB has snake_case
  fixes column p.MessageId does not exist error)
- add EFCore.NamingConventions 8.0.3 package reference
- pin version 8.0.3 (not wildcard 8.0.*)

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request configures the Worker service to use snake_case naming conventions for its database context and adds the required EFCore.NamingConventions dependency. Review feedback highlights the need to apply this same configuration to the ApiGateway project for consistency and recommends pinning the Microsoft.EntityFrameworkCore package version to 8.0.3 instead of using a wildcard to ensure environment stability.

Comment thread src/Worker/Program.cs
services.AddDbContext<AppDbContext>(options =>
options.UseNpgsql(configuration.GetConnectionString("DefaultConnection")));
options.UseNpgsql(configuration.GetConnectionString("DefaultConnection"))
.UseSnakeCaseNamingConvention());

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

The ApiGateway project also uses AppDbContext and maps to the same database tables (documents, processed_messages). Since these tables use snake_case columns, the ApiGateway will likely encounter the same 'column does not exist' errors unless .UseSnakeCaseNamingConvention() is also applied to its configuration and the EFCore.NamingConventions package is added to its project file.

Comment thread src/Worker/Worker.csproj
<PackageReference Include="EFCore.NamingConventions" Version="8.0.3" />
<PackageReference Include="MassTransit" Version="8.5.9" />
<PackageReference Include="MassTransit.RabbitMQ" Version="8.5.9" />
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="8.0.*" />

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The pull request description mentions pinning versions to 8.0.3 and avoiding wildcards, but Microsoft.EntityFrameworkCore is still using 8.0.*. For consistency and to prevent potential version mismatch issues between EF Core and its plugins, this should be pinned to 8.0.3 as well.

    <PackageReference Include="Microsoft.EntityFrameworkCore" Version="8.0.3" />

@cherninkiy
cherninkiy merged commit 1a3c895 into main May 12, 2026
2 checks passed
@cherninkiy
cherninkiy deleted the dev branch May 12, 2026 11:17
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant