Entity Data Model: Primitive Data Types

.NET Framework (current version)

The Entity Data Model (EDM) supports a set of abstract primitive data types (such as String, Boolean, Int32, and so on) that are used to define properties in a conceptual model. These primitive data types are proxies for actual primitive data types that are supported in the storage or hosting environment, such as a SQL Server database or the common language runtime (CLR). The EDM does not define the semantics of operations or conversions over primitive data types; these semantics are defined by the storage or hosting environment. Typically, primitive data types in the EDM are mapped to corresponding primitive data types in the storage or hosting environment. For information about how the Entity Framework maps primitive types in the EDM to SQL Server data types, see SqlClient for Entity FrameworkTypes.

System_CAPS_ICON_note.jpg Note

The EDM does not support collections of primitive data types.

For information about structured data types in the EDM, see entity type and complex type.

The table below lists the primitive data types supported by the EDM. The table also lists the facets that can be applied to each primitive data type.

Primitive Data TypeDescriptionApplicable Facets
BinaryContains binary data.MaxLength, FixedLength, Nullable, Default
BooleanContains the value true or false.Nullable, Default
ByteContains an unsigned 8-bit integer value.Precision, Nullable, Default
DateTimeRepresents a date and time.Precision, Nullable, Default
DateTimeOffsetContains a date and time as an offset in minutes from GMT.Precision, Nullable, Default
DecimalContains a numeric value with fixed precision and scale.Precision, Nullable, Default
DoubleContains a floating point number with 15 digit precision.Precision, Nullable, Default
FloatContains a floating point number with seven digit precision.Precision, Nullable, Default
GuidContains a 16-byte unique identifier.Precision, Nullable, Default
Int16Contains a signed 16-bit integer value.Precision, Nullable, Default
Int32Contains a signed 32-bit integer value.Precision, Nullable, Default
Int64Contains a signed 64-bit integer value.Precision, Nullable, Default
SByteContains a signed 8-bit integer value.Precision, Nullable, Default
StringContains character data.Unicode, FixedLength, MaxLength, Collation, Precision, Nullable, Default
TimeContains a time of day.Precision, Nullable, Default

Entity Data Model Key Concepts
Entity Data Model