Skip to content

Support entity type members defined through default interface implementation #36586

Description

@typesbb

What problem are you trying to solve?

First of all thanks for your work, efcore is very powerful!

If you define indexer properties only in the interface of the entity implementation, the ModelBuilder IndexerProperty method will report an error.

public interface IHasIndexerProperties
{
    protected virtual Dictionary<string,object> Data=>new Dictionary<string,object>();
    public virtual object this[string key]
    {
        get=>Data[key];
        set=>Data[key]=value;
    }
}
public class Blog:IHasIndexerProperties
{
    public string Url{get;set;}
}

modelBuilder.Entity<Blog>().IndexerProperty<int>("VisitCount");  // exception occurred 

Describe the solution you'd like

No response

Activity

  1. changed the title [-]Indexer Properties support the interface default indexer property[/-] [+]Support entity type members defined through default interface implementation[/+] on Aug 21, 2025
  2. added this to the Backlog milestone on Aug 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions