Skip to content

Indexed properties mapping support (part of property bag entities) #13610

@lajones

Description

@lajones

From discussion with @divega and @ajcvickers. We would like to support Entity classes with indexers:

    public class SomeEntity
    {
        public object this[string propertyName]
        {
            get
            {
                // get value of property named propertyName
            }

            set
            {
                // set value of property named propertyName
            }
        }
    }

You can then declare an indexed property in OnModelCreating() and have EF use the indexer to access that property, instead of expecting a member. (Note: this addresses parts of issues #2968 and #9914).

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions