Sequence contains no matching element - EntityFramework

后端 未结 10 1670
盖世英雄少女心
盖世英雄少女心 2020-12-17 08:43

I\'m using EF 6.1.0 and was creating a WCF Service.

First I created a Class Library containing my entities, Mappers and Context for initializing EF. I\'ve also creat

10条回答
  •  春和景丽
    2020-12-17 09:46

    Entity Framework throws this exception if the column type is invalid. For example:

    // This will throw an error. There is no such type name.
    [Column(TypeName = "Invalid")]
    public string Column1 { get; set; }
    
    // Works.
    [Column(TypeName = "varchar")]
    public string Column1 { get; set; }
    

    See these examples:

    • Example 1
    • Example 2
    • Other examples in comments.

提交回复
热议问题