efcore / EFCore.NamingConventions

Entity Framework Core plugin to apply naming conventions to table and column names (e.g. snake_case)
Apache License 2.0
738 stars 74 forks source link

Seems to be picking up some other package and not working #190

Closed chrisafl closed 1 year ago

chrisafl commented 1 year ago

Hello,

I have imported my schema using database first approach, but have quoting/capitalization issues and came across this package.

I have included it in my DbContext class

using EFCore.NamingConventions;

and I have modified OnConfiguring

protect override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
 => optionsBuilder.UseOracle("Name=ConnectionStrings:MYDB")
.UseUpperSnakeCaseNamingConvention();

The code editor is happy with this and it compiles. I noticed that the "using" line is greyed out, implying that it is not using EFCore.NamingConventions.

When I hover over the line .UseUpperSnakeCaseNamingConvention I see:

UseUpperSnakeCaseNamingConvention([System.Globalization.CulfureInfo? culture = null])

I am assuming it is using another package and I don't know how to remove that behavior.

When I run the code I get the "Table or view does not exist" error, and I can see in the console that it is querying with default behavior and ignoring EFCore.NamingConventions.

Any help is appreciated.

roji commented 1 year ago

There's not enough information above to understand what's going on; you're going to have to put together a minimal code sample that shows the problem.

Note that there is no need for you to do using EFCore.NamingConventions, since the extension method UseUpperSnakeCaseNamingConvention is defined in the namespace Microsoft.EntityFrameworkCore. That's why that using is grayed out; it doesn't indicate any issue and can be safely removed.

chrisafl commented 1 year ago

It is working, I had a dumb typo. Thank you!