Skip to content

Commit

Permalink
Cleanup pending 9914
Browse files Browse the repository at this point in the history
  • Loading branch information
smitpatel committed Jul 9, 2020
1 parent 9a7f5e7 commit 395bce0
Show file tree
Hide file tree
Showing 5 changed files with 3 additions and 33 deletions.
8 changes: 0 additions & 8 deletions src/EFCore/Metadata/Builders/CollectionCollectionBuilder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -99,14 +99,6 @@ public virtual EntityTypeBuilder UsingEntity(
Check.NotNull(configureRight, nameof(configureRight));
Check.NotNull(configureLeft, nameof(configureLeft));

if (((Model)LeftEntityType.Model).IsShared(joinEntityType))
{
//TODO #9914 - when the generic version of "please use the shared-type entity type version of this API"
// is available then update to use that.
throw new InvalidOperationException(
CoreStrings.DoNotUseUsingEntityOnSharedClrType(joinEntityType.GetType().Name));
}

var existingAssociationEntityType = (EntityType)
(LeftNavigation.ForeignKey?.DeclaringEntityType
?? RightNavigation.ForeignKey?.DeclaringEntityType);
Expand Down
8 changes: 0 additions & 8 deletions src/EFCore/Metadata/Builders/CollectionCollectionBuilder`.cs
Original file line number Diff line number Diff line change
Expand Up @@ -56,14 +56,6 @@ public virtual EntityTypeBuilder<TAssociationEntity> UsingEntity<TAssociationEnt
Check.NotNull(configureRight, nameof(configureRight));
Check.NotNull(configureLeft, nameof(configureLeft));

if (((Model)LeftEntityType.Model).IsShared(typeof(TAssociationEntity)))
{
//TODO #9914 - when the generic version of "please use the shared-type entity type version of this API"
// is available then update to use that.
throw new InvalidOperationException(
CoreStrings.DoNotUseUsingEntityOnSharedClrType(typeof(TAssociationEntity).Name));
}

var existingAssociationEntityType = (EntityType)
(LeftNavigation.ForeignKey?.DeclaringEntityType
?? RightNavigation.ForeignKey?.DeclaringEntityType);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,12 +106,9 @@ private void CreateAssociationEntityType(
inverseEntityType.ShortName()),
otherIdentifiers,
int.MaxValue);
//TODO #9914 - when the shared-type entity type version of model.Entity() is available call that instead
var associationEntityTypeBuilder =
model.AddEntityType(
associationEntityTypeName,
Model.DefaultPropertyBagType,
ConfigurationSource.Convention).Builder;

var associationEntityTypeBuilder = model.Builder.Entity(
associationEntityTypeName, Model.DefaultPropertyBagType, ConfigurationSource.Convention);

// Create left and right foreign keys from the outer entity types to
// the association entity type and configure the skip navigations.
Expand Down
8 changes: 0 additions & 8 deletions src/EFCore/Properties/CoreStrings.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 0 additions & 3 deletions src/EFCore/Properties/CoreStrings.resx
Original file line number Diff line number Diff line change
Expand Up @@ -1421,9 +1421,6 @@
<data name="PrincipalKeylessType" xml:space="preserve">
<value>The entity type '{entityType}' cannot be on the principal end of the relationship between '{firstNavigationSpecification}' and '{secondNavigationSpecification}'. The principal entity type must have a key.</value>
</data>
<data name="DoNotUseUsingEntityOnSharedClrType" xml:space="preserve">
<value>Cannot use UsingEntity() passing type '{clrType}' because the model contains shared entity type(s) with same type. Use a type which uniquely defines an entity type.</value>
</data>
<data name="ClashingMismatchedSharedType" xml:space="preserve">
<value>The shared type entity type '{entityType}' cannot be added to the model because a shared entity type with the same name but different clr type already exists.</value>
</data>
Expand Down

0 comments on commit 395bce0

Please sign in to comment.