Closed Steffen-M closed 6 years ago
What if you use fluent API instead of Data's notations? Are you generating from a dacpac or live database?
Fluent API shows the same results. I'm using a live database, but did a quick test using a dacpac. Same results. Thanks, Steffen
I have to revise my previous statement, sorry. Using dacpac yields the expected results. Fluent API or DataAnnotations does not matter.
OK, for the Dacpac implementation I am basing my implementation on the latest fixes in the product, https://github.com/aspnet/EntityFrameworkCore/commit/746ff59fae3d587269046604ecf964192958c7ec - I will investigate updating to 2.1-preview1
Thanks or reporting this.
Could you try the latest daily build, and let me know if it solves your issue
StringLength (HasMaxLength) is working now, but there seems to be a new issue: the namespace in the generated files do no longer have the project path appended.
the namespace in the generated files do no longer have the project path appended.
That is probably something I missed when upgradein to 2.1 - could you create an new issue and show me a sample of the issue (ie before and after) - TIA!
At least the column length of a string typed column ist not considered correctly, when the SQL data type is a User Defined Type.
Steps to reproduce
-- Create database CREATE TYPE [dbo].[EnumType] FROM SMALLINT NOT NULL; GO CREATE TYPE [dbo].[SymbolType] FROM VARCHAR (50) NOT NULL; GO CREATE TABLE [dbo].[BatchType] ( [Id] [dbo].[EnumType] NOT NULL, [Symbol] [dbo].[SymbolType] NOT NULL ); GO
The generated Model is: public partial class BatchType { [Column(TypeName = "EnumType")] public short Id { get; set; } [Required] [Column(TypeName = "SymbolType")] [StringLength(8000)] public string Symbol { get; set; } }
Further technical details
Version 4.7.539.0
SQL Server Compact 4.0 in GAC - Yes - 4.0.8876.1 SQL Server Compact 4.0 DbProvider - Yes
SQL Server Compact 4.0 DDEX provider - No SQL Server Compact 4.0 Simple DDEX provider - Yes
SQLite ADO.NET Provider included: 1.0.107.0 SQLite EF6 DbProvider in GAC - No
System.Data.SQLite DDEX provider - No SQLite Simple DDEX provider - Yes
Database engine: Microsoft SQL Server Developer (64-bit) Version 13.0.4001.0
Microsoft Visual Studio Enterprise 2017 Version 15.6.3 VisualStudio.15.Release/15.6.3+27428.2011 Microsoft .NET Framework Version 4.7.02558