Some IEntity metadata properties return null values
Steps to reproduce
IProperty property = ientityType.FindProperty(propertyName); if (property == null) return null;
int? maxlenght; if (property.GetMaxLength().HasValue) { maxlenght = property.GetMaxLength(); }
string entityFullName = string.Format(CultureInfo.CurrentCulture, "{0}.{1}", ientityType.SqlServer().Schema, ientityType.SqlServer().TableName);
The issue
The method property.GetMaxLength() of IEntityType return null sometimes and the property.GetMaxLength().HasValue return false, but the property.SqlServer().ColumnType return 'Maxlenth(4)'
The property ientityType.SqlServer().Schema return null value if schema is dbo
Further technical details
EF Core version 1 Operating system: Windows 10 Visual Studio version: (e.g. VS 2015 or n/a)
@JuanIrigoyen GetMaxLength only returns a value if it has been set directly. EF does not currently extract values from relational-specific type mappings and use them to populate the core metadata MaxLength.