diff --git a/framework/src/Volo.Abp.EntityFrameworkCore/Volo/Abp/EntityFrameworkCore/AbpDbContext.cs b/framework/src/Volo.Abp.EntityFrameworkCore/Volo/Abp/EntityFrameworkCore/AbpDbContext.cs index 29c88194f6..22f04542f1 100644 --- a/framework/src/Volo.Abp.EntityFrameworkCore/Volo/Abp/EntityFrameworkCore/AbpDbContext.cs +++ b/framework/src/Volo.Abp.EntityFrameworkCore/Volo/Abp/EntityFrameworkCore/AbpDbContext.cs @@ -31,13 +31,11 @@ using Volo.Abp.Uow; namespace Volo.Abp.EntityFrameworkCore { - public abstract class AbpDbContext : DbContext, IAbpEfCoreDbContext, ITransientDependency, IHasExtraProperties + public abstract class AbpDbContext : DbContext, IAbpEfCoreDbContext, ITransientDependency where TDbContext : DbContext { public IAbpLazyServiceProvider LazyServiceProvider { get; set; } - public ExtraPropertyDictionary ExtraProperties { get; } - protected virtual Guid? CurrentTenantId => CurrentTenant?.Id; protected virtual bool IsMultiTenantFilterEnabled => DataFilter?.IsEnabled() ?? false; @@ -88,7 +86,6 @@ namespace Volo.Abp.EntityFrameworkCore protected AbpDbContext(DbContextOptions options) : base(options) { - ExtraProperties = new ExtraPropertyDictionary(); } protected override void OnModelCreating(ModelBuilder modelBuilder) diff --git a/framework/src/Volo.Abp.EntityFrameworkCore/Volo/Abp/ObjectExtending/EfCoreObjectExtensionManagerExtensions.cs b/framework/src/Volo.Abp.EntityFrameworkCore/Volo/Abp/ObjectExtending/EfCoreObjectExtensionManagerExtensions.cs index 2701ce8e29..0a22162104 100644 --- a/framework/src/Volo.Abp.EntityFrameworkCore/Volo/Abp/ObjectExtending/EfCoreObjectExtensionManagerExtensions.cs +++ b/framework/src/Volo.Abp.EntityFrameworkCore/Volo/Abp/ObjectExtending/EfCoreObjectExtensionManagerExtensions.cs @@ -12,7 +12,7 @@ namespace Volo.Abp.ObjectExtending public static ObjectExtensionManager MapEfCoreDbContext( [NotNull] this ObjectExtensionManager objectExtensionManager, [NotNull] Action modelBuilderAction) - where TDbContext: DbContext , IHasExtraProperties + where TDbContext : DbContext { return objectExtensionManager.AddOrUpdate( typeof(TDbContext), @@ -25,7 +25,7 @@ namespace Volo.Abp.ObjectExtending public static ObjectExtensionManager MapEfCoreEntity( [NotNull] this ObjectExtensionManager objectExtensionManager, [NotNull] Action entityTypeBuildAction) - where TEntity : IHasExtraProperties, IEntity + where TEntity : IEntity { return MapEfCoreEntity( objectExtensionManager, diff --git a/framework/src/Volo.Abp.ObjectExtending/Volo/Abp/ObjectExtending/ObjectExtensionInfo.cs b/framework/src/Volo.Abp.ObjectExtending/Volo/Abp/ObjectExtending/ObjectExtensionInfo.cs index d54ee7104a..18b3c2c73d 100644 --- a/framework/src/Volo.Abp.ObjectExtending/Volo/Abp/ObjectExtending/ObjectExtensionInfo.cs +++ b/framework/src/Volo.Abp.ObjectExtending/Volo/Abp/ObjectExtending/ObjectExtensionInfo.cs @@ -23,7 +23,7 @@ namespace Volo.Abp.ObjectExtending public ObjectExtensionInfo([NotNull] Type type) { - Type = Check.AssignableTo(type, nameof(type)); + Type = type; Properties = new ConcurrentDictionary(); Configuration = new ConcurrentDictionary(); Validators = new List>(); diff --git a/framework/src/Volo.Abp.ObjectExtending/Volo/Abp/ObjectExtending/ObjectExtensionManager.cs b/framework/src/Volo.Abp.ObjectExtending/Volo/Abp/ObjectExtending/ObjectExtensionManager.cs index 4cbc3a3fb8..85a60a2824 100644 --- a/framework/src/Volo.Abp.ObjectExtending/Volo/Abp/ObjectExtending/ObjectExtensionManager.cs +++ b/framework/src/Volo.Abp.ObjectExtending/Volo/Abp/ObjectExtending/ObjectExtensionManager.cs @@ -25,7 +25,6 @@ namespace Volo.Abp.ObjectExtending [NotNull] public virtual ObjectExtensionManager AddOrUpdate( [CanBeNull] Action configureAction = null) - where TObject : IHasExtraProperties { return AddOrUpdate(typeof(TObject), configureAction); } @@ -50,8 +49,6 @@ namespace Volo.Abp.ObjectExtending [NotNull] Type type, [CanBeNull] Action configureAction = null) { - Check.AssignableTo(type, nameof(type)); - var extensionInfo = ObjectsExtensions.GetOrAdd( type, _ => new ObjectExtensionInfo(type) @@ -64,7 +61,6 @@ namespace Volo.Abp.ObjectExtending [CanBeNull] public virtual ObjectExtensionInfo GetOrNull() - where TObject : IHasExtraProperties { return GetOrNull(typeof(TObject)); } @@ -72,8 +68,6 @@ namespace Volo.Abp.ObjectExtending [CanBeNull] public virtual ObjectExtensionInfo GetOrNull([NotNull] Type type) { - Check.AssignableTo(type, nameof(type)); - return ObjectsExtensions.GetOrDefault(type); }