I have an object that has a char property:
public class Product
{
public char Code
{
get;
set;
}
}
Entity Frame
In Fluent API you can specify the database column data type using the HasColumnType method like this:
modelBuilder.Entity()
.Property(p => p.Code)
.HasColumnType("char");
According to Andre Artus' answer here, HasColumnType is available in EF4.1.
For those using Data Annotations, the ColumnAttribute can accomplish the same thing.
[Column(TypeName="char")]
public string Code { get; set; }