efcore/EFCore.NamingConventions

Seems to be picking up some other package and not working

chrisafl opened this issue · 2 comments

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

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.

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