-
Notifications
You must be signed in to change notification settings - Fork 53
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
NullReferenceException with EntityTypeTransformationService.TransformNavPropertyName #136
Comments
I'm using 3.1.7 versions of EntityFrameworkCore components |
Which version of the Handlebars package? Which EF Core provider and version? |
Microsoft.EntityFrameworkCore = 3.1.7 |
Possible related to ErikEJ/EFCorePowerTools#463 |
We need your database schema |
I just emailed it to you @ErikEJ |
@tonysneed could I send the schema to your private email? If so, could you send your email address? |
Or you can email me at grady at singenuity com and I'll reply with the schema FYI I do not have EF Power Tools installed |
@gdycus If you run the command The column 'Merchandise.Products.Taxable' would normally be mapped to a non-nullable bool property, but it has a default constraint. Such a column is mapped to a nullable bool property to allow a difference between setting the property to false and invoking the default constraint. See https://go.microsoft.com/fwlink/?linkid=851278 for details. |
Why would that warning cause a NRE? |
…rvice.TransformNavPropertyName. Fixes #136.
Perfect, I just updated EF Core Power Tools, and the fix is available in the latest daily build |
It's working now. Thanks! |
Getting the following error when executing "dotnet ef dbcontext scaffold". Any thoughts on what might cause this error? Thanks!
System.NullReferenceException: Object reference not set to an instance of an object.
at EntityFrameworkCore.Scaffolding.Handlebars.HbsCSharpDbContextGenerator.GenerateRelationship(IForeignKey foreignKey, Boolean useDataAnnotations, IndentedStringBuilder sb)
at EntityFrameworkCore.Scaffolding.Handlebars.HbsCSharpDbContextGenerator.GenerateEntityType(IEntityType entityType, Boolean useDataAnnotations, IndentedStringBuilder sb)
at EntityFrameworkCore.Scaffolding.Handlebars.HbsCSharpDbContextGenerator.GenerateOnModelCreating(IModel model, Boolean useDataAnnotations)
at EntityFrameworkCore.Scaffolding.Handlebars.HbsCSharpDbContextGenerator.GenerateClass(IModel model, String contextName, String connectionString, Boolean useDataAnnotations, Boolean suppressConnectionStringWarning)
at EntityFrameworkCore.Scaffolding.Handlebars.HbsCSharpDbContextGenerator.WriteCode(IModel model, String contextName, String connectionString, String contextNamespace, String modelNamespace, Boolean useDataAnnotations, Boolean suppressConnectionStringWarning)
at EntityFrameworkCore.Scaffolding.Handlebars.HbsCSharpModelGenerator.GenerateModel(IModel model, ModelCodeGenerationOptions options)
at Microsoft.EntityFrameworkCore.Scaffolding.Internal.ReverseEngineerScaffolder.ScaffoldModel(String connectionString, DatabaseModelFactoryOptions databaseOptions, ModelReverseEngineerOptions modelOptions, ModelCodeGenerationOptions codeOptions)
at Microsoft.EntityFrameworkCore.Design.Internal.DatabaseOperations.ScaffoldContext(String provider, String connectionString, String outputDir, String outputContextDir, String dbContextClassName, IEnumerable
1 schemas, IEnumerable
1 tables, Boolean useDataAnnotations, Boolean overwriteFiles, Boolean useDatabaseNames)at Microsoft.EntityFrameworkCore.Design.OperationExecutor.ScaffoldContextImpl(String provider, String connectionString, String outputDir, String outputDbContextDir, String dbContextClassName, IEnumerable
1 schemaFilters, IEnumerable
1 tableFilters, Boolean useDataAnnotations, Boolean overwriteFiles, Boolean useDatabaseNames)at Microsoft.EntityFrameworkCore.Design.OperationExecutor.ScaffoldContext.<>c__DisplayClass0_0.<.ctor>b__0()
at Microsoft.EntityFrameworkCore.Design.OperationExecutor.OperationBase.<>c__DisplayClass3_0`1.b__0()
The text was updated successfully, but these errors were encountered: