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
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.
ID: eeeaa642-e6b3-e469-f3ba-d57a74770659
Version Independent ID: 5d69f26b-f6ba-378b-2692-9922c19473e4
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().
This documentation states that
HasAlternateKey
will "force the properties to be read-only" and we should "useHasIndex(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.
1.xml](https://github.com/aspnet/EntityFramework.ApiDocs/blob/live/dotnet/xml/Microsoft.EntityFrameworkCore.Metadata.Builders/EntityTypeBuilder
1.xml)The text was updated successfully, but these errors were encountered: