-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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
Add overloads of UsingEntity() that take advantage of conventions #21535
Labels
area-conventions
area-model-building
closed-fixed
The issue has been fixed and is/will be included in the release indicated by the issue milestone.
type-enhancement
Milestone
Comments
Also consider overloads in #21505 (comment) @AndriySvyryd wrote EntityTypeBuilder UsingEntity(
[NotNull] name,
[NotNull] Func<EntityTypeBuilder, ReferenceCollectionBuilder> configureRight,
[NotNull] Func<EntityTypeBuilder, ReferenceCollectionBuilder> configureLeft);
EntityTypeBuilder<TLeftEntity> UsingEntity(
[NotNull] name,
[NotNull] Func<EntityTypeBuilder, ReferenceCollectionBuilder> configureRight,
[NotNull] Func<EntityTypeBuilder, ReferenceCollectionBuilder> configureLeft,
[NotNull] Action<EntityTypeBuilder> configureAssociation); If the specified name doesn't match any existing entity type then we'll assume the CLR type to be |
73 tasks
Can we have a sample plz ? |
AndriySvyryd
added a commit
that referenced
this issue
Jul 29, 2021
AndriySvyryd
added
closed-fixed
The issue has been fixed and is/will be included in the release indicated by the issue milestone.
and removed
needs-design
labels
Jul 29, 2021
AndriySvyryd
added a commit
that referenced
this issue
Jul 30, 2021
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
area-conventions
area-model-building
closed-fixed
The issue has been fixed and is/will be included in the release indicated by the issue milestone.
type-enhancement
We don't need this for 5.0, but it would be nice to add some sugar.
Each overload will have a version that takes a
Type
, a version that takes a name and a version that take neither (we'll assume the type isDictionary<string, object>
and generate the type name based on the related entity types). Also there'll be a version of each that returns the builder for the association entity type and one that takes it as a nested lambda as well as the non-generic flavor (~9 variations of each in total). I'll only show theType
with nested lambda overloads here for brevity.We'll use the FKs found by convention if there's exactly one compatible FK to each of the entity types in the M2M. The PK will be configured as composite over those FKs, so in the simple case
configureAssociation
could benull
This one additionally allows to configure the FKs that we found. This version will throw immediately if the FKs are not found or are ambiguous.
The text was updated successfully, but these errors were encountered: