Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Question regarding complex path to entities #4336

Closed
EternaleapFromPit opened this issue May 1, 2023 · 2 comments
Closed

Question regarding complex path to entities #4336

EternaleapFromPit opened this issue May 1, 2023 · 2 comments

Comments

@EternaleapFromPit
Copy link

Hi

It's not obvious whether it's possible to provide complex path like that somehow:
builder.HasIndex(entity => new { entity.UpperLevelField, entity.InternalMappedInstance.Field }).IsUnique()
Wheh I use it like that it gives the error. Providing char array doesn't work too.

Regards,
Vlad.


Document Details

Do not edit this section. It is required for learn.microsoft.com ➟ GitHub issue linking.

  • ID: 2d7751b1-4430-a31c-bf32-0839f5f885b8
  • Version Independent ID: 438949c9-1a1e-5bea-0bbe-ecd17de33865
  • Content: EntityTypeBuilder<TEntity>.HasIndex Method (Microsoft.EntityFrameworkCore.Metadata.Builders)
  • Content Source: [dotnet/xml/Microsoft.EntityFrameworkCore.Metadata.Builders/EntityTypeBuilder1.xml](https://github.com/dotnet/EntityFramework.ApiDocs/blob/live/dotnet/xml/Microsoft.EntityFrameworkCore.Metadata.Builders/EntityTypeBuilder1.xml)
  • Product: ef-core-api
  • GitHub Login: @dotnet-bot
  • Microsoft Alias: avickers
@ajcvickers
Copy link
Member

As you found out, that syntax is not supported.

@ajcvickers
Copy link
Member

Issue is tracked here: dotnet/efcore#11336

@ajcvickers ajcvickers closed this as not planned Won't fix, can't repro, duplicate, stale May 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants