Incomplete EF 7 scaffolding on AdventureWorks2019

93 views Asked by At

I have finally managed to get my context generated from AdventureWorks2019 with this command:

Scaffold-DbContext "Name=ConnectionStrings:connection" Microsoft.EntityFrameworkCore.SqlServer -OutputDir Models

Where the connection string is stored in appsettings.json.

The build succeeded and I have my (albeit unweildy) model classes.

But the results were far from perfect as I have the following result:

Could not find type mapping for column 'HumanResources.Employee.OrganizationNode' with data type 'hierarchyid'. Skipping column.

The column 'HumanResources.Employee.SalariedFlag' 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. The column 'HumanResources.Employee.CurrentFlag' 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. Unable to scaffold the index 'IX_Employee_OrganizationLevel_OrganizationNode'. The following columns could not be scaffolded: OrganizationNode. Unable to scaffold the index 'IX_Employee_OrganizationNode'. The following columns could not be scaffolded: OrganizationNode. Could not find type mapping for column 'Person.Address.SpatialLocation' with data type 'geography'. Skipping column. The column 'Person.StateProvince.IsOnlyStateProvinceFlag' 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. Could not find type mapping for column 'Production.Document.DocumentNode' with data type 'hierarchyid'. Skipping column. Could not scaffold the primary key for 'Production.Document'. The following columns in the primary key could not be scaffolded: DocumentNode. Unable to generate entity type for table 'Production.Document' since its primary key could not be scaffolded. The column 'Production.Product.MakeFlag' 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. The column 'Production.Product.FinishedGoodsFlag' 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. Could not find type mapping for column 'Production.ProductDocument.DocumentNode' with data type 'hierarchyid'. Skipping column. Could not scaffold the primary key for 'Production.ProductDocument'. The following columns in the primary key could not be scaffolded: DocumentNode. Unable to generate entity type for table 'Production.ProductDocument' since its primary key could not be scaffolded. The column 'Purchasing.Vendor.PreferredVendorStatus' 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. The column 'Purchasing.Vendor.ActiveFlag' 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. The column 'Sales.SalesOrderHeader.OnlineOrderFlag' 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.

0

There are 0 answers