dotnet / dotnet/efcore

Support entity type members defined through default interface implementation

Open
#36,586 0 comments 0 reactions 1 assignee Claimed by @AndriySvyryd View on GitHub
area-model-building area-o/c-mapping customer-reported
Dominant language
C#
Stars
14.8k
Forks
3.4k
PR merge metrics
PR metrics pending

Description

### 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.
``` csharp
public interface IHasIndexerProperties
{
protected virtual Dictionary Data=>new Dictionary();
public virtual object this[string key]
{
get=>Data[key];
set=>Data[key]=value;
}
}
public class Blog:IHasIndexerProperties
{
public string Url{get;set;}
}

modelBuilder.Entity().IndexerProperty("VisitCount"); // exception occurred
```

### Describe the solution you'd like

_No response_

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.