Open mattmentrup opened 3 months ago
I identified the issue that Microsoft EntityFramework will set the Name value for the key after the entity has been declared as a view to null.
I submitted a PR #280 to handle this fix by adjusting the INameRewriter.RewriteName signature to accept the nullable string value and can return a nullable string value.
@mattmentrup thanks.. I'm very busy right now with other priorities - I traditionally turn my attention to this plugin close to the release time in November, when other components are already frozen etc. Just to set expectations in terms of reviewing etc - but I'll definitely take a look later in the year.
Not a problem, thanks for maintaining this plugin. Solved my issue with naming schemas for oracle at work.
Core 6 Oracle.EntityFrameworkCore 6 EFCore.NamingConvention, Latest on NuGet.org
Naming Convention Used: UsedSnakeCaseNamingConvetion, UseUpperSnakeCaseNamingConvention
During the
OnModelCreating(ModelBuilder)
, when configuring the modelBuilder with a View and that view has keys defined, the RewriteName function throws an 'object reference not set to an instance of an object' error.Interestingly enough, when declaring the
ToView
after theHasKey
method, the error above is not thrown.For example, the below snippet does not cause the error to occur.