3

Using indexers on a poco with entity framework code first throws the error "Indexed properties are not supported." when saving the context.

Is there a way to use indexers on pocos with entity framework code first? I tried applying the [NotMapped] attribute to the indexer declaration but it did not help.

user1018364
  • 285
  • 1
  • 4
  • 10
  • It seems [like limitation](http://stackoverflow.com/questions/6199442/let-entity-framework-code-first-ignore-an-indexed-property) of EF fluent mapping. – Ladislav Mrnka Oct 28 '11 at 13:40
  • 1
    Indeed, I have filed a [report](http://connect.microsoft.com/VisualStudio/feedback/details/754309/entity-framework-code-first-cannot-ignore-custom-class-indexers-in-entitytypeconfiguration) on Microsoft connect site for this issue.. – cleftheris Jul 23 '12 at 14:27

1 Answers1

0

Try using WriteEDMX to see whether the EDMX is referencing those properties - I suspect it isn't and that the limitation is with the core EF runtime not Code First (Code First is finished by the time you create your first DbContext).

DamienG
  • 6,575
  • 27
  • 43