Search code examples
c#entity-frameworkvisual-studiocode-firstscaffolding

Where is a list of Entity Framework's unsupported types?


Either I am blind, or there is no published/searchable list of C# types that Entity Framework skips or does not support when building a code-first database. If I am blind, please lead me. Else, please link me - and everyone else who cannot locate this important documentation omission.

Using several variations on the search terms "entity framework" "code first" type not supported, I found only obsolete and incomplete references, usually dated 2009 or earlier. I tried asking several MVPs directly - all of whom list C#, VS, MVC, and/or EF as one of their specialties - to no avail. In the absence of comprehensive & current search results and responses from any of them, I wonder if this documentation exists.


Solution

  • The scalar types that Entity Framework supports are defined in the Entity Data Model. In addition to scalars, complex types (made up of scalars or other complex types) are also supported.

    So basically instead of the blacklist that the question asks for, you have a whitelist:

    Binary
    Boolean
    Byte
    DateTime
    DateTimeOffset
    Decimal
    Double
    Float
    Guid
    Int16
    Int32
    Int64
    SByte
    String
    Time