You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Indexed properties mapping support (part of property bag entities) #13610
From discussion with @divega and @ajcvickers. We would like to support Entity classes with indexers:
publicclassSomeEntity{publicobjectthis[stringpropertyName]{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).
Reacted by Allen Cook, Maxim and Vasim Hanna-Salem
Few questions: @AndriySvyryd or @ajcvickers if there are already answers or we can discuss in design meeting to decide.
Should there be AddIndexedProperty method on IMutableEntityType? Specifying memberInfo is bit cumbersome and if we know we are adding indexed property then we can fetch it from entityType.ClrType directly.
Fluent API? or to be discussed later?
Fields
Can indexer be field in C# (I really don't know)?
Current design assumes it to be always a propertyInfo.
Indexer properties can be configured to use backing field just like any other property.
Is there a need or should we support mapping indexer to a backing field dictionary which would be accessed directly?
Activity
[-]Indexed Properties Feature[/-][+]Indexed properties mapping support[/+][-]Indexed properties mapping support[/-][+]Indexed properties mapping support (part of property bag entities)[/+]Metadata: Add Getter/Setter support for indexed properties
smitpatel commentedon Dec 31, 2019
Few questions:
@AndriySvyryd or @ajcvickers if there are already answers or we can discuss in design meeting to decide.
AddIndexedPropertymethod onIMutableEntityType? Specifying memberInfo is bit cumbersome and if we know we are adding indexed property then we can fetch it from entityType.ClrType directly.AndriySvyryd commentedon Dec 31, 2019
AddIndexedPropertyextension method or default interface implementation as sugar if it's useful..IndexedProperty<int>("Id")would be my first suggestion19 remaining items
Query: Add indexed property support
Query: Add indexed property support
Query: Add indexed property support
Metadata: Add Fluent API to configure Indexed properties
Metadata: Add Fluent API to configure Indexed properties
Metadata: Add Fluent API to configure Indexed properties
bigworld12 commentedon Apr 13, 2020
will this issue be related to fixing #13084 and #2968
ajcvickers commentedon Apr 13, 2020
@bigworld12 This issue is unrelated to the two that you mention.