Quantcast
Channel: Entity Framework
Viewing all articles
Browse latest Browse all 10318

Commented Issue: UpForGrabs: Code First: Class with two indexers throws Sequence contains more than one matching element [612]

$
0
0
Repro Steps:
put inside a mapped class a custom indexer with two overloads like so:
public decimal this[int month] {
get {
return _someArray[month];
}
set {
_someArray[month] = value;
}
}

public decimal this[int front, int month] {
get {
return _someArray2D[front - 1, month - 1];
}
set {
_someArray2D[front - 1, month - 1] = value;
}
}


I get 'Sequence contains more than one matching element'


This item was migrated from the DevDiv work item tracking system [ID=458598].

This work item originated from connect.microsoft.com. A member of the EF team at Microsoft should close the related Connect issue when closing this work item.
Comments: It actually threw an Argument exception saying that 'Item' was already in the metadata collection. But in any case the fix works.

Viewing all articles
Browse latest Browse all 10318

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>