I get 'Sequence contains more than one matching element'This error is not a matter of query but a matter of mapping configuration. It seems that regardless the query you are calling the EF code first will throw the error when a duplicate matching property is found on the class. I am guessing that it is looping through PropertyInfos with in the class public setters. There can be duplicate property names either because c# is case sensitive so 'MyProperty', 'myproperty' both map to the same column, or in my case because of custom class indexers.So for class indexers: The .net framework reflects indexers as properties with parameters. There is currently no way to ignore a custom indexer in an EntityFramework code first mapping file because the lambda expression has no way of expressing these kind of special properties. As this was not enough, my class had an overloaded indexer (hence the error 'Sequence contains more than one matching element')more on this bug here http://stackoverflow.com/a/11521336/61577
Visual Studio/Team Foundation Server/.NET Framework Tooling Version
Steps to reproduce
Product Language
Operating System
Operating System Language
Actual results
Expected results
Please wait...