-
Notifications
You must be signed in to change notification settings - Fork 3.3k
Sugar for HasForeignKey/HasPrincipalKey #6003
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Conversation
/// The name(s) of the foreign key property(s). | ||
/// </param> | ||
/// <returns> The same builder instance so that multiple configuration calls can be chained. </returns> | ||
public virtual ReferenceReferenceBuilder HasForeignKey<TDependentEntity>( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this have a class constraint to match the other APIs in CF?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will do.
|
@@ -314,9 +314,15 @@ public GenericTestReferenceReferenceBuilder(ReferenceReferenceBuilder<TEntity, T | |||
public override TestReferenceReferenceBuilder<TEntity, TRelatedEntity> HasForeignKey(Type dependentEntityType, params string[] foreignKeyPropertyNames) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The Type overload should be removed from base. The current implementation would become the implementation of the new overload in ModelBuilderNonGenericTest
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will do.
4d37958
to
498fc01
Compare
@AndriySvyryd Pushed an update. |
|
Issue #5377 Added back generic overloads so that in the common case of a shadow property in CLR entity types the generic method can be used instead of using typeof(). Also, only for these APIs, the short name of the type can be passed as a string since the resolution space is very small--it just checks the name at either end of the relationship.
498fc01
to
53cea6f
Compare
Issue #5377
Added back generic overloads so that in the common case of a shadow property in CLR entity types the generic method can be used instead of using typeof().
Also, only for these APIs, the short name of the type can be passed as a string since the resolution space is very small--it just checks the name at either end of the relationship.