Skip to content

Commit

Permalink
Removed convention to add AdHoc annotation
Browse files Browse the repository at this point in the history
  • Loading branch information
ajcvickers committed Jan 11, 2023
1 parent 23e88e8 commit 3f2736a
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 21 deletions.
20 changes: 0 additions & 20 deletions src/EFCore/Metadata/Conventions/AdHocModelInitializedConvention.cs

This file was deleted.

2 changes: 1 addition & 1 deletion src/EFCore/Metadata/Internal/AdHocMapper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,6 @@ private ConventionSet ConventionSet
_conventionSet.Remove(typeof(ValueGenerationConvention));
_conventionSet.Remove(typeof(BaseTypeDiscoveryConvention));
_conventionSet.Remove(typeof(DiscriminatorConvention));
_conventionSet.Add(new AdHocModelInitializedConvention());
}

return _conventionSet;
Expand All @@ -84,6 +83,7 @@ public virtual RuntimeEntityType GetOrAddEntityType(Type clrType)
private RuntimeEntityType AddEntityType(Type clrType)
{
var modelBuilder = new ModelBuilder(ConventionSet, _modelCreationDependencies.ModelDependencies);
modelBuilder.HasAnnotation(CoreAnnotationNames.AdHocModel, true);
modelBuilder.Entity(clrType).HasNoKey();
var finalizedModel = modelBuilder.FinalizeModel();
var runtimeModel = _modelCreationDependencies.ModelRuntimeInitializer.Initialize(
Expand Down

0 comments on commit 3f2736a

Please sign in to comment.