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

Incorrect/misleading documentation regarding uniqueness of HasIndex #1319

Closed
irontoby opened this issue Feb 27, 2019 — with docs.microsoft.com · 2 comments
Closed

Comments

Copy link

irontoby commented Feb 27, 2019

This documentation states that HasAlternateKey will "force the properties to be read-only" and we should "use HasIndex(Expression<Func<TEntity,Object>>) to specify uniqueness in the model that does not force properties to be read-only."

However, HasIndex(Expression<Func<TEntity,Object>>) does not actually create a unique index; it creates a non-unique index. This sentence should be removed or clarified to indicate whether there's another way to create a unique index which is not read-only.


Document Details

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

@irontoby
Copy link
Author

My apologies, I just realized that it is indeed possible to create a unique index using .HasIndex(...).IsUnique(). Perhaps the documentation could be clarified to mention IsUnique().

@ajcvickers
Copy link
Contributor

Duplicate of dotnet/efcore#17508

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants