For the CHAR/VARCHAR columns we need to make sure to use IsUnicode(false) in the configuration files. I profiled the current query and I see that the parameter is passed as nvarchar(4000) for char(10) columns. The size problem is a EF problem, but nvarchar can be avoided by this enhancement.
Comments: I made the changes in our copy of the core.ttinclude file. I added public bool IsFixedLength; public bool IsUnicode; and then Config = string.Format("Property(x => x.{0}).HasColumnName(\"{1}\"){2}{3}{4}{5}{6}{7};", PropertyNameHumanCase, Name, (IsNullable) ? ".IsOptional()" : ".IsRequired()", (IsFixedLength) ? ".IsFixedLength()" : "", (IsUnicode) ? string.Empty : ".IsUnicode(false)", (MaxLength > 0 && MaxLength < 8000) ? ".HasMaxLength(" + MaxLength + ")" : string.Empty, (Scale > 0) ? ".HasPrecision(" + Precision + "," + Scale + ")" : string.Empty, (IsRowVersion) ? ".IsFixedLength().IsRowVersion()" : string.Empty, databaseGeneratedOption); and also col.IsFixedLength = (typename == "char" || typename == "nchar"); col.IsUnicode = !(typename == "char" || typename == "varchar" || typename == "text"); to include IsUnicode(false). I also found that the classes has double using of DataAnnotations, so I commented out the final using statement for now.
Comments: I made the changes in our copy of the core.ttinclude file. I added public bool IsFixedLength; public bool IsUnicode; and then Config = string.Format("Property(x => x.{0}).HasColumnName(\"{1}\"){2}{3}{4}{5}{6}{7};", PropertyNameHumanCase, Name, (IsNullable) ? ".IsOptional()" : ".IsRequired()", (IsFixedLength) ? ".IsFixedLength()" : "", (IsUnicode) ? string.Empty : ".IsUnicode(false)", (MaxLength > 0 && MaxLength < 8000) ? ".HasMaxLength(" + MaxLength + ")" : string.Empty, (Scale > 0) ? ".HasPrecision(" + Precision + "," + Scale + ")" : string.Empty, (IsRowVersion) ? ".IsFixedLength().IsRowVersion()" : string.Empty, databaseGeneratedOption); and also col.IsFixedLength = (typename == "char" || typename == "nchar"); col.IsUnicode = !(typename == "char" || typename == "varchar" || typename == "text"); to include IsUnicode(false). I also found that the classes has double using of DataAnnotations, so I commented out the final using statement for now.