When I try to map a column to a char data type in my model class I get an error:
The property ‘[ColumnName]’ is not a
declared property on type ‘[ClassName]’.
Verify that the property has not been
explicitly excluded from the model by
using the Ignore method or
NotMappedAttribute data annotation.
Make sure that it is a valid primitive
property.
What are the valid primitive types for EF Code First?
This is interesting but you really cannot map
charproperty. I just checked it and if you want to havechar(1)in the database you must usestringproperty with following mapping:It is not only problem of Code-first. It is whole EF limitation because EDMX designer also doesn’t show
chartype. I think allowed types will be same as described in CSDL reference for EDMX because code first is just wrapper around the same mapping infrastructure.