From 1413dec836645d0e4a933948432b1b49dcb17cd1 Mon Sep 17 00:00:00 2001 From: liangshiwei Date: Tue, 21 Sep 2021 15:24:48 +0800 Subject: [PATCH 1/3] Remove ModelBuilderConfigurationOptions of all modules --- ...tLoggingDbContextModelBuilderExtensions.cs | 22 ++----- ...LoggingModelBuilderConfigurationOptions.cs | 18 ------ ...AbpAuditLoggingMongoDbContextExtensions.cs | 14 +---- ...ngMongoModelBuilderConfigurationOptions.cs | 14 ----- ...undJobsDbContextModelCreatingExtensions.cs | 12 +--- ...undJobsModelBuilderConfigurationOptions.cs | 18 ------ .../BackgroundJobsMongoDbContextExtensions.cs | 16 ++--- ...bsMongoModelBuilderConfigurationOptions.cs | 14 ----- ...StoringDbContextModelCreatingExtensions.cs | 15 +---- ...StoringModelBuilderConfigurationOptions.cs | 18 ------ .../BlobStoringMongoDbContextExtensions.cs | 18 ++---- ...ngMongoModelBuilderConfigurationOptions.cs | 14 ----- ...BloggingDbContextModelBuilderExtensions.cs | 25 +++----- ...loggingModelBuilderConfigurationOptions.cs | 15 ----- .../BloggingMongoDbContextExtensions.cs | 22 +++---- ...ngMongoModelBuilderConfigurationOptions.cs | 14 ----- .../CmsKitDbContextModelCreatingExtensions.cs | 35 ++++------- .../CmsKitModelBuilderConfigurationOptions.cs | 18 ------ .../MongoDB/CmsKitMongoDbContextExtensions.cs | 12 +--- ...itMongoModelBuilderConfigurationOptions.cs | 14 ----- .../DocsDbContextModelBuilderExtensions.cs | 19 ++---- .../DocsModelBuilderConfigurationOptions.cs | 15 ----- .../MongoDB/DocsMongoDbContextExtensions.cs | 16 ++--- ...csMongoModelBuilderConfigurationOptions.cs | 14 ----- ...agementDbContextModelCreatingExtensions.cs | 12 +--- ...agementModelBuilderConfigurationOptions.cs | 18 ------ ...atureManagementMongoDbContextExtensions.cs | 14 +---- ...ntMongoModelBuilderConfigurationOptions.cs | 15 ----- ...yServerDbContextModelCreatingExtensions.cs | 59 ++++++++----------- ...yServerModelBuilderConfigurationOptions.cs | 23 -------- ...pIdentityServerMongoDbContextExtensions.cs | 24 +++----- ...erMongoModelBuilderConfigurationOptions.cs | 13 ---- ...nagementDbContextModelBuilderExtensions.cs | 15 +---- ...agementModelBuilderConfigurationOptions.cs | 18 ------ ...ssionManagementMongoDbContextExtensions.cs | 14 +---- ...ntMongoModelBuilderConfigurationOptions.cs | 14 ----- ...nagementDbContextModelBuilderExtensions.cs | 28 +-------- ...ttingManagementMongoDbContextExtensions.cs | 12 +--- ...ntMongoModelBuilderConfigurationOptions.cs | 14 ----- ...agementDbContextModelCreatingExtensions.cs | 15 +---- ...agementModelBuilderConfigurationOptions.cs | 18 ------ ...enantManagementMongoDbContextExtensions.cs | 14 +---- ...ntMongoModelBuilderConfigurationOptions.cs | 14 ----- 43 files changed, 117 insertions(+), 649 deletions(-) delete mode 100644 modules/audit-logging/src/Volo.Abp.AuditLogging.EntityFrameworkCore/Volo/Abp/AuditLogging/EntityFrameworkCore/AbpAuditLoggingModelBuilderConfigurationOptions.cs delete mode 100644 modules/audit-logging/src/Volo.Abp.AuditLogging.MongoDB/Volo/Abp/AuditLogging/MongoDB/AuditLoggingMongoModelBuilderConfigurationOptions.cs delete mode 100644 modules/background-jobs/src/Volo.Abp.BackgroundJobs.EntityFrameworkCore/Volo/Abp/BackgroundJobs/EntityFrameworkCore/BackgroundJobsModelBuilderConfigurationOptions.cs delete mode 100644 modules/background-jobs/src/Volo.Abp.BackgroundJobs.MongoDB/Volo/Abp/BackgroundJobs/MongoDB/BackgroundJobsMongoModelBuilderConfigurationOptions.cs delete mode 100644 modules/blob-storing-database/src/Volo.Abp.BlobStoring.Database.EntityFrameworkCore/Volo/Abp/BlobStoring/Database/EntityFrameworkCore/BlobStoringModelBuilderConfigurationOptions.cs delete mode 100644 modules/blob-storing-database/src/Volo.Abp.BlobStoring.Database.MongoDB/Volo/Abp/BlobStoring/Database/MongoDB/BlobStoringMongoModelBuilderConfigurationOptions.cs delete mode 100644 modules/blogging/src/Volo.Blogging.EntityFrameworkCore/Volo/Blogging/EntityFrameworkCore/BloggingModelBuilderConfigurationOptions.cs delete mode 100644 modules/blogging/src/Volo.Blogging.MongoDB/Volo/Blogging/MongoDB/BloggingMongoModelBuilderConfigurationOptions.cs delete mode 100644 modules/cms-kit/src/Volo.CmsKit.EntityFrameworkCore/Volo/CmsKit/EntityFrameworkCore/CmsKitModelBuilderConfigurationOptions.cs delete mode 100644 modules/cms-kit/src/Volo.CmsKit.MongoDB/Volo/CmsKit/MongoDB/CmsKitMongoModelBuilderConfigurationOptions.cs delete mode 100644 modules/docs/src/Volo.Docs.EntityFrameworkCore/Volo/Docs/EntityFrameworkCore/DocsModelBuilderConfigurationOptions.cs delete mode 100644 modules/docs/src/Volo.Docs.MongoDB/Volo/Docs/MongoDB/DocsMongoModelBuilderConfigurationOptions.cs delete mode 100644 modules/feature-management/src/Volo.Abp.FeatureManagement.EntityFrameworkCore/Volo/Abp/FeatureManagement/EntityFrameworkCore/FeatureManagementModelBuilderConfigurationOptions.cs delete mode 100644 modules/feature-management/src/Volo.Abp.FeatureManagement.MongoDB/Volo/Abp/FeatureManagement/MongoDB/FeatureManagementMongoModelBuilderConfigurationOptions.cs delete mode 100644 modules/identityserver/src/Volo.Abp.IdentityServer.EntityFrameworkCore/Volo/Abp/IdentityServer/EntityFrameworkCore/IdentityServerModelBuilderConfigurationOptions.cs delete mode 100644 modules/identityserver/src/Volo.Abp.IdentityServer.MongoDB/Volo/Abp/IdentityServer/MongoDB/IdentityServerMongoModelBuilderConfigurationOptions.cs delete mode 100644 modules/permission-management/src/Volo.Abp.PermissionManagement.EntityFrameworkCore/Volo/Abp/PermissionManagement/EntityFrameworkCore/AbpPermissionManagementModelBuilderConfigurationOptions.cs delete mode 100644 modules/permission-management/src/Volo.Abp.PermissionManagement.MongoDB/Volo/Abp/PermissionManagement/MongoDb/PermissionManagementMongoModelBuilderConfigurationOptions.cs delete mode 100644 modules/setting-management/src/Volo.Abp.SettingManagement.MongoDB/Volo/Abp/SettingManagement/MongoDB/SettingManagementMongoModelBuilderConfigurationOptions.cs delete mode 100644 modules/tenant-management/src/Volo.Abp.TenantManagement.EntityFrameworkCore/Volo/Abp/TenantManagement/EntityFrameworkCore/AbpTenantManagementModelBuilderConfigurationOptions.cs delete mode 100644 modules/tenant-management/src/Volo.Abp.TenantManagement.MongoDB/Volo/Abp/TenantManagement/MongoDb/TenantManagementMongoModelBuilderConfigurationOptions.cs diff --git a/modules/audit-logging/src/Volo.Abp.AuditLogging.EntityFrameworkCore/Volo/Abp/AuditLogging/EntityFrameworkCore/AbpAuditLoggingDbContextModelBuilderExtensions.cs b/modules/audit-logging/src/Volo.Abp.AuditLogging.EntityFrameworkCore/Volo/Abp/AuditLogging/EntityFrameworkCore/AbpAuditLoggingDbContextModelBuilderExtensions.cs index 51c30ef0a1..37abf469ef 100644 --- a/modules/audit-logging/src/Volo.Abp.AuditLogging.EntityFrameworkCore/Volo/Abp/AuditLogging/EntityFrameworkCore/AbpAuditLoggingDbContextModelBuilderExtensions.cs +++ b/modules/audit-logging/src/Volo.Abp.AuditLogging.EntityFrameworkCore/Volo/Abp/AuditLogging/EntityFrameworkCore/AbpAuditLoggingDbContextModelBuilderExtensions.cs @@ -1,29 +1,19 @@ -using System; -using JetBrains.Annotations; +using JetBrains.Annotations; using Microsoft.EntityFrameworkCore; using Volo.Abp.EntityFrameworkCore.Modeling; -using Volo.Abp.Identity.EntityFrameworkCore; namespace Volo.Abp.AuditLogging.EntityFrameworkCore { public static class AbpAuditLoggingDbContextModelBuilderExtensions { public static void ConfigureAuditLogging( - [NotNull] this ModelBuilder builder, - Action optionsAction = null) + [NotNull] this ModelBuilder builder) { Check.NotNull(builder, nameof(builder)); - var options = new AbpAuditLoggingModelBuilderConfigurationOptions( - AbpAuditLoggingDbProperties.DbTablePrefix, - AbpAuditLoggingDbProperties.DbSchema - ); - - optionsAction?.Invoke(options); - builder.Entity(b => { - b.ToTable(options.TablePrefix + "AuditLogs", options.Schema); + b.ToTable(AbpAuditLoggingDbProperties.DbTablePrefix + "AuditLogs", AbpAuditLoggingDbProperties.DbSchema); b.ConfigureByConvention(); @@ -56,7 +46,7 @@ namespace Volo.Abp.AuditLogging.EntityFrameworkCore builder.Entity(b => { - b.ToTable(options.TablePrefix + "AuditLogActions", options.Schema); + b.ToTable(AbpAuditLoggingDbProperties.DbTablePrefix + "AuditLogActions", AbpAuditLoggingDbProperties.DbSchema); b.ConfigureByConvention(); @@ -75,7 +65,7 @@ namespace Volo.Abp.AuditLogging.EntityFrameworkCore builder.Entity(b => { - b.ToTable(options.TablePrefix + "EntityChanges", options.Schema); + b.ToTable(AbpAuditLoggingDbProperties.DbTablePrefix + "EntityChanges", AbpAuditLoggingDbProperties.DbSchema); b.ConfigureByConvention(); @@ -96,7 +86,7 @@ namespace Volo.Abp.AuditLogging.EntityFrameworkCore builder.Entity(b => { - b.ToTable(options.TablePrefix + "EntityPropertyChanges", options.Schema); + b.ToTable(AbpAuditLoggingDbProperties.DbTablePrefix + "EntityPropertyChanges", AbpAuditLoggingDbProperties.DbSchema); b.ConfigureByConvention(); diff --git a/modules/audit-logging/src/Volo.Abp.AuditLogging.EntityFrameworkCore/Volo/Abp/AuditLogging/EntityFrameworkCore/AbpAuditLoggingModelBuilderConfigurationOptions.cs b/modules/audit-logging/src/Volo.Abp.AuditLogging.EntityFrameworkCore/Volo/Abp/AuditLogging/EntityFrameworkCore/AbpAuditLoggingModelBuilderConfigurationOptions.cs deleted file mode 100644 index 404ce00d0b..0000000000 --- a/modules/audit-logging/src/Volo.Abp.AuditLogging.EntityFrameworkCore/Volo/Abp/AuditLogging/EntityFrameworkCore/AbpAuditLoggingModelBuilderConfigurationOptions.cs +++ /dev/null @@ -1,18 +0,0 @@ -using JetBrains.Annotations; -using Volo.Abp.EntityFrameworkCore.Modeling; - -namespace Volo.Abp.Identity.EntityFrameworkCore -{ - public class AbpAuditLoggingModelBuilderConfigurationOptions : AbpModelBuilderConfigurationOptions - { - public AbpAuditLoggingModelBuilderConfigurationOptions( - [NotNull] string tablePrefix, - [CanBeNull] string schema) - : base( - tablePrefix, - schema) - { - - } - } -} \ No newline at end of file diff --git a/modules/audit-logging/src/Volo.Abp.AuditLogging.MongoDB/Volo/Abp/AuditLogging/MongoDB/AbpAuditLoggingMongoDbContextExtensions.cs b/modules/audit-logging/src/Volo.Abp.AuditLogging.MongoDB/Volo/Abp/AuditLogging/MongoDB/AbpAuditLoggingMongoDbContextExtensions.cs index 40411691cb..48b60107ff 100644 --- a/modules/audit-logging/src/Volo.Abp.AuditLogging.MongoDB/Volo/Abp/AuditLogging/MongoDB/AbpAuditLoggingMongoDbContextExtensions.cs +++ b/modules/audit-logging/src/Volo.Abp.AuditLogging.MongoDB/Volo/Abp/AuditLogging/MongoDB/AbpAuditLoggingMongoDbContextExtensions.cs @@ -1,25 +1,17 @@ -using System; -using Volo.Abp.MongoDB; +using Volo.Abp.MongoDB; namespace Volo.Abp.AuditLogging.MongoDB { public static class AbpAuditLoggingMongoDbContextExtensions { public static void ConfigureAuditLogging( - this IMongoModelBuilder builder, - Action optionsAction = null) + this IMongoModelBuilder builder) { Check.NotNull(builder, nameof(builder)); - var options = new AuditLoggingMongoModelBuilderConfigurationOptions( - AbpAuditLoggingDbProperties.DbTablePrefix - ); - - optionsAction?.Invoke(options); - builder.Entity(b => { - b.CollectionName = options.CollectionPrefix + "AuditLogs"; + b.CollectionName = AbpAuditLoggingDbProperties.DbTablePrefix + "AuditLogs"; }); } } diff --git a/modules/audit-logging/src/Volo.Abp.AuditLogging.MongoDB/Volo/Abp/AuditLogging/MongoDB/AuditLoggingMongoModelBuilderConfigurationOptions.cs b/modules/audit-logging/src/Volo.Abp.AuditLogging.MongoDB/Volo/Abp/AuditLogging/MongoDB/AuditLoggingMongoModelBuilderConfigurationOptions.cs deleted file mode 100644 index 553ba4d01c..0000000000 --- a/modules/audit-logging/src/Volo.Abp.AuditLogging.MongoDB/Volo/Abp/AuditLogging/MongoDB/AuditLoggingMongoModelBuilderConfigurationOptions.cs +++ /dev/null @@ -1,14 +0,0 @@ -using JetBrains.Annotations; -using Volo.Abp.MongoDB; - -namespace Volo.Abp.AuditLogging.MongoDB -{ - public class AuditLoggingMongoModelBuilderConfigurationOptions : AbpMongoModelBuilderConfigurationOptions - { - public AuditLoggingMongoModelBuilderConfigurationOptions( - [NotNull] string collectionPrefix = "") - : base(collectionPrefix) - { - } - } -} diff --git a/modules/background-jobs/src/Volo.Abp.BackgroundJobs.EntityFrameworkCore/Volo/Abp/BackgroundJobs/EntityFrameworkCore/BackgroundJobsDbContextModelCreatingExtensions.cs b/modules/background-jobs/src/Volo.Abp.BackgroundJobs.EntityFrameworkCore/Volo/Abp/BackgroundJobs/EntityFrameworkCore/BackgroundJobsDbContextModelCreatingExtensions.cs index 76d39a77ae..1781c7067d 100644 --- a/modules/background-jobs/src/Volo.Abp.BackgroundJobs.EntityFrameworkCore/Volo/Abp/BackgroundJobs/EntityFrameworkCore/BackgroundJobsDbContextModelCreatingExtensions.cs +++ b/modules/background-jobs/src/Volo.Abp.BackgroundJobs.EntityFrameworkCore/Volo/Abp/BackgroundJobs/EntityFrameworkCore/BackgroundJobsDbContextModelCreatingExtensions.cs @@ -7,8 +7,7 @@ namespace Volo.Abp.BackgroundJobs.EntityFrameworkCore public static class BackgroundJobsDbContextModelCreatingExtensions { public static void ConfigureBackgroundJobs( - this ModelBuilder builder, - Action optionsAction = null) + this ModelBuilder builder) { Check.NotNull(builder, nameof(builder)); @@ -17,16 +16,9 @@ namespace Volo.Abp.BackgroundJobs.EntityFrameworkCore return; } - var options = new BackgroundJobsModelBuilderConfigurationOptions( - BackgroundJobsDbProperties.DbTablePrefix, - BackgroundJobsDbProperties.DbSchema - ); - - optionsAction?.Invoke(options); - builder.Entity(b => { - b.ToTable(options.TablePrefix + "BackgroundJobs", options.Schema); + b.ToTable(BackgroundJobsDbProperties.DbTablePrefix + "BackgroundJobs", BackgroundJobsDbProperties.DbSchema); b.ConfigureByConvention(); diff --git a/modules/background-jobs/src/Volo.Abp.BackgroundJobs.EntityFrameworkCore/Volo/Abp/BackgroundJobs/EntityFrameworkCore/BackgroundJobsModelBuilderConfigurationOptions.cs b/modules/background-jobs/src/Volo.Abp.BackgroundJobs.EntityFrameworkCore/Volo/Abp/BackgroundJobs/EntityFrameworkCore/BackgroundJobsModelBuilderConfigurationOptions.cs deleted file mode 100644 index 47734aa3a3..0000000000 --- a/modules/background-jobs/src/Volo.Abp.BackgroundJobs.EntityFrameworkCore/Volo/Abp/BackgroundJobs/EntityFrameworkCore/BackgroundJobsModelBuilderConfigurationOptions.cs +++ /dev/null @@ -1,18 +0,0 @@ -using JetBrains.Annotations; -using Volo.Abp.EntityFrameworkCore.Modeling; - -namespace Volo.Abp.BackgroundJobs.EntityFrameworkCore -{ - public class BackgroundJobsModelBuilderConfigurationOptions : AbpModelBuilderConfigurationOptions - { - public BackgroundJobsModelBuilderConfigurationOptions( - [NotNull] string tablePrefix = "", - [CanBeNull] string schema = null) - : base( - tablePrefix, - schema) - { - - } - } -} \ No newline at end of file diff --git a/modules/background-jobs/src/Volo.Abp.BackgroundJobs.MongoDB/Volo/Abp/BackgroundJobs/MongoDB/BackgroundJobsMongoDbContextExtensions.cs b/modules/background-jobs/src/Volo.Abp.BackgroundJobs.MongoDB/Volo/Abp/BackgroundJobs/MongoDB/BackgroundJobsMongoDbContextExtensions.cs index 31291f2d9b..410218e5e6 100644 --- a/modules/background-jobs/src/Volo.Abp.BackgroundJobs.MongoDB/Volo/Abp/BackgroundJobs/MongoDB/BackgroundJobsMongoDbContextExtensions.cs +++ b/modules/background-jobs/src/Volo.Abp.BackgroundJobs.MongoDB/Volo/Abp/BackgroundJobs/MongoDB/BackgroundJobsMongoDbContextExtensions.cs @@ -1,26 +1,18 @@ -using System; -using Volo.Abp.MongoDB; +using Volo.Abp.MongoDB; namespace Volo.Abp.BackgroundJobs.MongoDB { public static class BackgroundJobsMongoDbContextExtensions { public static void ConfigureBackgroundJobs( - this IMongoModelBuilder builder, - Action optionsAction = null) + this IMongoModelBuilder builder) { Check.NotNull(builder, nameof(builder)); - var options = new BackgroundJobsMongoModelBuilderConfigurationOptions( - BackgroundJobsDbProperties.DbTablePrefix - ); - - optionsAction?.Invoke(options); - builder.Entity(b => { - b.CollectionName = options.CollectionPrefix + "BackgroundJobs"; + b.CollectionName = BackgroundJobsDbProperties.DbTablePrefix + "BackgroundJobs"; }); } } -} \ No newline at end of file +} diff --git a/modules/background-jobs/src/Volo.Abp.BackgroundJobs.MongoDB/Volo/Abp/BackgroundJobs/MongoDB/BackgroundJobsMongoModelBuilderConfigurationOptions.cs b/modules/background-jobs/src/Volo.Abp.BackgroundJobs.MongoDB/Volo/Abp/BackgroundJobs/MongoDB/BackgroundJobsMongoModelBuilderConfigurationOptions.cs deleted file mode 100644 index 7590fb0d12..0000000000 --- a/modules/background-jobs/src/Volo.Abp.BackgroundJobs.MongoDB/Volo/Abp/BackgroundJobs/MongoDB/BackgroundJobsMongoModelBuilderConfigurationOptions.cs +++ /dev/null @@ -1,14 +0,0 @@ -using JetBrains.Annotations; -using Volo.Abp.MongoDB; - -namespace Volo.Abp.BackgroundJobs.MongoDB -{ - public class BackgroundJobsMongoModelBuilderConfigurationOptions : AbpMongoModelBuilderConfigurationOptions - { - public BackgroundJobsMongoModelBuilderConfigurationOptions( - [NotNull] string collectionPrefix = "") - : base(collectionPrefix) - { - } - } -} \ No newline at end of file diff --git a/modules/blob-storing-database/src/Volo.Abp.BlobStoring.Database.EntityFrameworkCore/Volo/Abp/BlobStoring/Database/EntityFrameworkCore/BlobStoringDbContextModelCreatingExtensions.cs b/modules/blob-storing-database/src/Volo.Abp.BlobStoring.Database.EntityFrameworkCore/Volo/Abp/BlobStoring/Database/EntityFrameworkCore/BlobStoringDbContextModelCreatingExtensions.cs index ddcaae7911..fe0e289fb1 100644 --- a/modules/blob-storing-database/src/Volo.Abp.BlobStoring.Database.EntityFrameworkCore/Volo/Abp/BlobStoring/Database/EntityFrameworkCore/BlobStoringDbContextModelCreatingExtensions.cs +++ b/modules/blob-storing-database/src/Volo.Abp.BlobStoring.Database.EntityFrameworkCore/Volo/Abp/BlobStoring/Database/EntityFrameworkCore/BlobStoringDbContextModelCreatingExtensions.cs @@ -1,5 +1,4 @@ using Microsoft.EntityFrameworkCore; -using System; using Volo.Abp.EntityFrameworkCore.Modeling; namespace Volo.Abp.BlobStoring.Database.EntityFrameworkCore @@ -7,21 +6,13 @@ namespace Volo.Abp.BlobStoring.Database.EntityFrameworkCore public static class BlobStoringDbContextModelCreatingExtensions { public static void ConfigureBlobStoring( - this ModelBuilder builder, - Action optionsAction = null) + this ModelBuilder builder) { Check.NotNull(builder, nameof(builder)); - var options = new BlobStoringModelBuilderConfigurationOptions( - BlobStoringDatabaseDbProperties.DbTablePrefix, - BlobStoringDatabaseDbProperties.DbSchema - ); - - optionsAction?.Invoke(options); - builder.Entity(b => { - b.ToTable(options.TablePrefix + "BlobContainers", options.Schema); + b.ToTable(BlobStoringDatabaseDbProperties.DbTablePrefix + "BlobContainers", BlobStoringDatabaseDbProperties.DbSchema); b.ConfigureByConvention(); @@ -36,7 +27,7 @@ namespace Volo.Abp.BlobStoring.Database.EntityFrameworkCore builder.Entity(b => { - b.ToTable(options.TablePrefix + "Blobs", options.Schema); + b.ToTable(BlobStoringDatabaseDbProperties.DbTablePrefix + "Blobs", BlobStoringDatabaseDbProperties.DbSchema); b.ConfigureByConvention(); diff --git a/modules/blob-storing-database/src/Volo.Abp.BlobStoring.Database.EntityFrameworkCore/Volo/Abp/BlobStoring/Database/EntityFrameworkCore/BlobStoringModelBuilderConfigurationOptions.cs b/modules/blob-storing-database/src/Volo.Abp.BlobStoring.Database.EntityFrameworkCore/Volo/Abp/BlobStoring/Database/EntityFrameworkCore/BlobStoringModelBuilderConfigurationOptions.cs deleted file mode 100644 index fce10576be..0000000000 --- a/modules/blob-storing-database/src/Volo.Abp.BlobStoring.Database.EntityFrameworkCore/Volo/Abp/BlobStoring/Database/EntityFrameworkCore/BlobStoringModelBuilderConfigurationOptions.cs +++ /dev/null @@ -1,18 +0,0 @@ -using JetBrains.Annotations; -using Volo.Abp.EntityFrameworkCore.Modeling; - -namespace Volo.Abp.BlobStoring.Database.EntityFrameworkCore -{ - public class BlobStoringModelBuilderConfigurationOptions : AbpModelBuilderConfigurationOptions - { - public BlobStoringModelBuilderConfigurationOptions( - [NotNull] string tablePrefix = "", - [CanBeNull] string schema = null) - : base( - tablePrefix, - schema) - { - - } - } -} \ No newline at end of file diff --git a/modules/blob-storing-database/src/Volo.Abp.BlobStoring.Database.MongoDB/Volo/Abp/BlobStoring/Database/MongoDB/BlobStoringMongoDbContextExtensions.cs b/modules/blob-storing-database/src/Volo.Abp.BlobStoring.Database.MongoDB/Volo/Abp/BlobStoring/Database/MongoDB/BlobStoringMongoDbContextExtensions.cs index f96f991bc9..cc5b6720b7 100644 --- a/modules/blob-storing-database/src/Volo.Abp.BlobStoring.Database.MongoDB/Volo/Abp/BlobStoring/Database/MongoDB/BlobStoringMongoDbContextExtensions.cs +++ b/modules/blob-storing-database/src/Volo.Abp.BlobStoring.Database.MongoDB/Volo/Abp/BlobStoring/Database/MongoDB/BlobStoringMongoDbContextExtensions.cs @@ -1,31 +1,23 @@ -using System; -using Volo.Abp.MongoDB; +using Volo.Abp.MongoDB; namespace Volo.Abp.BlobStoring.Database.MongoDB { public static class BlobStoringMongoDbContextExtensions { public static void ConfigureBlobStoring( - this IMongoModelBuilder builder, - Action optionsAction = null) + this IMongoModelBuilder builder) { Check.NotNull(builder, nameof(builder)); - var options = new BlobStoringMongoModelBuilderConfigurationOptions( - BlobStoringDatabaseDbProperties.DbTablePrefix - ); - - optionsAction?.Invoke(options); - builder.Entity(b => { - b.CollectionName = options.CollectionPrefix + "BlobContainers"; + b.CollectionName = BlobStoringDatabaseDbProperties.DbTablePrefix + "BlobContainers"; }); builder.Entity(b => { - b.CollectionName = options.CollectionPrefix + "Blobs"; + b.CollectionName = BlobStoringDatabaseDbProperties.DbTablePrefix + "Blobs"; }); } } -} \ No newline at end of file +} diff --git a/modules/blob-storing-database/src/Volo.Abp.BlobStoring.Database.MongoDB/Volo/Abp/BlobStoring/Database/MongoDB/BlobStoringMongoModelBuilderConfigurationOptions.cs b/modules/blob-storing-database/src/Volo.Abp.BlobStoring.Database.MongoDB/Volo/Abp/BlobStoring/Database/MongoDB/BlobStoringMongoModelBuilderConfigurationOptions.cs deleted file mode 100644 index f0f786e1dd..0000000000 --- a/modules/blob-storing-database/src/Volo.Abp.BlobStoring.Database.MongoDB/Volo/Abp/BlobStoring/Database/MongoDB/BlobStoringMongoModelBuilderConfigurationOptions.cs +++ /dev/null @@ -1,14 +0,0 @@ -using JetBrains.Annotations; -using Volo.Abp.MongoDB; - -namespace Volo.Abp.BlobStoring.Database.MongoDB -{ - public class BlobStoringMongoModelBuilderConfigurationOptions : AbpMongoModelBuilderConfigurationOptions - { - public BlobStoringMongoModelBuilderConfigurationOptions( - [NotNull] string collectionPrefix = "") - : base(collectionPrefix) - { - } - } -} \ No newline at end of file diff --git a/modules/blogging/src/Volo.Blogging.EntityFrameworkCore/Volo/Blogging/EntityFrameworkCore/BloggingDbContextModelBuilderExtensions.cs b/modules/blogging/src/Volo.Blogging.EntityFrameworkCore/Volo/Blogging/EntityFrameworkCore/BloggingDbContextModelBuilderExtensions.cs index 4a0d23a0fb..3386da25a5 100644 --- a/modules/blogging/src/Volo.Blogging.EntityFrameworkCore/Volo/Blogging/EntityFrameworkCore/BloggingDbContextModelBuilderExtensions.cs +++ b/modules/blogging/src/Volo.Blogging.EntityFrameworkCore/Volo/Blogging/EntityFrameworkCore/BloggingDbContextModelBuilderExtensions.cs @@ -1,5 +1,4 @@ -using System; -using JetBrains.Annotations; +using JetBrains.Annotations; using Microsoft.EntityFrameworkCore; using Volo.Abp; using Volo.Abp.EntityFrameworkCore.Modeling; @@ -15,8 +14,7 @@ namespace Volo.Blogging.EntityFrameworkCore public static class BloggingDbContextModelBuilderExtensions { public static void ConfigureBlogging( - [NotNull] this ModelBuilder builder, - Action optionsAction = null) + [NotNull] this ModelBuilder builder) { Check.NotNull(builder, nameof(builder)); @@ -25,16 +23,9 @@ namespace Volo.Blogging.EntityFrameworkCore return; } - var options = new BloggingModelBuilderConfigurationOptions( - BloggingDbProperties.DbTablePrefix, - BloggingDbProperties.DbSchema - ); - - optionsAction?.Invoke(options); - builder.Entity(b => { - b.ToTable(options.TablePrefix + "Users", options.Schema); + b.ToTable(BloggingDbProperties.DbTablePrefix + "Users", BloggingDbProperties.DbSchema); b.ConfigureByConvention(); b.ConfigureAbpUser(); @@ -44,7 +35,7 @@ namespace Volo.Blogging.EntityFrameworkCore builder.Entity(b => { - b.ToTable(options.TablePrefix + "Blogs", options.Schema); + b.ToTable(BloggingDbProperties.DbTablePrefix + "Blogs", BloggingDbProperties.DbSchema); b.ConfigureByConvention(); @@ -57,7 +48,7 @@ namespace Volo.Blogging.EntityFrameworkCore builder.Entity(b => { - b.ToTable(options.TablePrefix + "Posts", options.Schema); + b.ToTable(BloggingDbProperties.DbTablePrefix + "Posts", BloggingDbProperties.DbSchema); b.ConfigureByConvention(); @@ -77,7 +68,7 @@ namespace Volo.Blogging.EntityFrameworkCore builder.Entity(b => { - b.ToTable(options.TablePrefix + "Comments", options.Schema); + b.ToTable(BloggingDbProperties.DbTablePrefix + "Comments", BloggingDbProperties.DbSchema); b.ConfigureByConvention(); @@ -93,7 +84,7 @@ namespace Volo.Blogging.EntityFrameworkCore builder.Entity(b => { - b.ToTable(options.TablePrefix + "Tags", options.Schema); + b.ToTable(BloggingDbProperties.DbTablePrefix + "Tags", BloggingDbProperties.DbSchema); b.ConfigureByConvention(); @@ -108,7 +99,7 @@ namespace Volo.Blogging.EntityFrameworkCore builder.Entity(b => { - b.ToTable(options.TablePrefix + "PostTags", options.Schema); + b.ToTable(BloggingDbProperties.DbTablePrefix + "PostTags", BloggingDbProperties.DbSchema); b.ConfigureByConvention(); diff --git a/modules/blogging/src/Volo.Blogging.EntityFrameworkCore/Volo/Blogging/EntityFrameworkCore/BloggingModelBuilderConfigurationOptions.cs b/modules/blogging/src/Volo.Blogging.EntityFrameworkCore/Volo/Blogging/EntityFrameworkCore/BloggingModelBuilderConfigurationOptions.cs deleted file mode 100644 index af888ab402..0000000000 --- a/modules/blogging/src/Volo.Blogging.EntityFrameworkCore/Volo/Blogging/EntityFrameworkCore/BloggingModelBuilderConfigurationOptions.cs +++ /dev/null @@ -1,15 +0,0 @@ -using JetBrains.Annotations; -using Volo.Abp.EntityFrameworkCore.Modeling; - -namespace Volo.Blogging.EntityFrameworkCore -{ - public class BloggingModelBuilderConfigurationOptions : AbpModelBuilderConfigurationOptions - { - public BloggingModelBuilderConfigurationOptions( - [NotNull] string tablePrefix = "", - [CanBeNull] string schema = null) - : base(tablePrefix, schema) - { - } - } -} \ No newline at end of file diff --git a/modules/blogging/src/Volo.Blogging.MongoDB/Volo/Blogging/MongoDB/BloggingMongoDbContextExtensions.cs b/modules/blogging/src/Volo.Blogging.MongoDB/Volo/Blogging/MongoDB/BloggingMongoDbContextExtensions.cs index 3defbc1287..b04f0a74fc 100644 --- a/modules/blogging/src/Volo.Blogging.MongoDB/Volo/Blogging/MongoDB/BloggingMongoDbContextExtensions.cs +++ b/modules/blogging/src/Volo.Blogging.MongoDB/Volo/Blogging/MongoDB/BloggingMongoDbContextExtensions.cs @@ -1,5 +1,4 @@ -using System; -using Volo.Abp; +using Volo.Abp; using Volo.Abp.MongoDB; using Volo.Blogging.Blogs; using Volo.Blogging.Comments; @@ -11,40 +10,33 @@ namespace Volo.Blogging.MongoDB public static class BloggingMongoDbContextExtensions { public static void ConfigureBlogging( - this IMongoModelBuilder builder, - Action optionsAction = null) + this IMongoModelBuilder builder) { Check.NotNull(builder, nameof(builder)); - var options = new BloggingMongoModelBuilderConfigurationOptions( - BloggingDbProperties.DbTablePrefix - ); - - optionsAction?.Invoke(options); - builder.Entity(b => { - b.CollectionName = options.CollectionPrefix + "Users"; + b.CollectionName = BloggingDbProperties.DbTablePrefix + "Users"; }); builder.Entity(b => { - b.CollectionName = options.CollectionPrefix + "Blogs"; + b.CollectionName = BloggingDbProperties.DbTablePrefix + "Blogs"; }); builder.Entity(b => { - b.CollectionName = options.CollectionPrefix + "Posts"; + b.CollectionName = BloggingDbProperties.DbTablePrefix + "Posts"; }); builder.Entity(b => { - b.CollectionName = options.CollectionPrefix + "Tags"; + b.CollectionName = BloggingDbProperties.DbTablePrefix + "Tags"; }); builder.Entity(b => { - b.CollectionName = options.CollectionPrefix + "Comments"; + b.CollectionName = BloggingDbProperties.DbTablePrefix + "Comments"; }); } } diff --git a/modules/blogging/src/Volo.Blogging.MongoDB/Volo/Blogging/MongoDB/BloggingMongoModelBuilderConfigurationOptions.cs b/modules/blogging/src/Volo.Blogging.MongoDB/Volo/Blogging/MongoDB/BloggingMongoModelBuilderConfigurationOptions.cs deleted file mode 100644 index d2fb415166..0000000000 --- a/modules/blogging/src/Volo.Blogging.MongoDB/Volo/Blogging/MongoDB/BloggingMongoModelBuilderConfigurationOptions.cs +++ /dev/null @@ -1,14 +0,0 @@ -using JetBrains.Annotations; -using Volo.Abp.MongoDB; - -namespace Volo.Blogging.MongoDB -{ - public class BloggingMongoModelBuilderConfigurationOptions : AbpMongoModelBuilderConfigurationOptions - { - public BloggingMongoModelBuilderConfigurationOptions( - [NotNull] string collectionPrefix = "") - : base(collectionPrefix) - { - } - } -} diff --git a/modules/cms-kit/src/Volo.CmsKit.EntityFrameworkCore/Volo/CmsKit/EntityFrameworkCore/CmsKitDbContextModelCreatingExtensions.cs b/modules/cms-kit/src/Volo.CmsKit.EntityFrameworkCore/Volo/CmsKit/EntityFrameworkCore/CmsKitDbContextModelCreatingExtensions.cs index f7964c1711..14a242a9de 100644 --- a/modules/cms-kit/src/Volo.CmsKit.EntityFrameworkCore/Volo/CmsKit/EntityFrameworkCore/CmsKitDbContextModelCreatingExtensions.cs +++ b/modules/cms-kit/src/Volo.CmsKit.EntityFrameworkCore/Volo/CmsKit/EntityFrameworkCore/CmsKitDbContextModelCreatingExtensions.cs @@ -1,5 +1,4 @@ using Microsoft.EntityFrameworkCore; -using System; using Volo.Abp; using Volo.Abp.EntityFrameworkCore.Modeling; using Volo.Abp.GlobalFeatures; @@ -20,23 +19,15 @@ namespace Volo.CmsKit.EntityFrameworkCore public static class CmsKitDbContextModelCreatingExtensions { public static void ConfigureCmsKit( - this ModelBuilder builder, - Action optionsAction = null) + this ModelBuilder builder) { Check.NotNull(builder, nameof(builder)); - var options = new CmsKitModelBuilderConfigurationOptions( - CmsKitDbProperties.DbTablePrefix, - CmsKitDbProperties.DbSchema - ); - - optionsAction?.Invoke(options); - if (GlobalFeatureManager.Instance.IsEnabled()) { builder.Entity(b => { - b.ToTable(options.TablePrefix + "Users", options.Schema); + b.ToTable(CmsKitDbProperties.DbTablePrefix + "Users", CmsKitDbProperties.DbSchema); b.ConfigureByConvention(); b.ConfigureAbpUser(); @@ -56,7 +47,7 @@ namespace Volo.CmsKit.EntityFrameworkCore { builder.Entity(b => { - b.ToTable(options.TablePrefix + "UserReactions", options.Schema); + b.ToTable(CmsKitDbProperties.DbTablePrefix + "UserReactions", CmsKitDbProperties.DbSchema); b.ConfigureByConvention(); @@ -79,7 +70,7 @@ namespace Volo.CmsKit.EntityFrameworkCore { builder.Entity(b => { - b.ToTable(options.TablePrefix + "Comments", options.Schema); + b.ToTable(CmsKitDbProperties.DbTablePrefix + "Comments", CmsKitDbProperties.DbSchema); b.ConfigureByConvention(); @@ -103,7 +94,7 @@ namespace Volo.CmsKit.EntityFrameworkCore { builder.Entity(r => { - r.ToTable(options.TablePrefix + "Ratings", options.Schema); + r.ToTable(CmsKitDbProperties.DbTablePrefix + "Ratings", CmsKitDbProperties.DbSchema); r.ConfigureByConvention(); @@ -125,7 +116,7 @@ namespace Volo.CmsKit.EntityFrameworkCore { builder.Entity(b => { - b.ToTable(options.TablePrefix + "Tags", options.Schema); + b.ToTable(CmsKitDbProperties.DbTablePrefix + "Tags", CmsKitDbProperties.DbSchema); b.ConfigureByConvention(); @@ -143,7 +134,7 @@ namespace Volo.CmsKit.EntityFrameworkCore builder.Entity(b => { - b.ToTable(options.TablePrefix + "EntityTags", options.Schema); + b.ToTable(CmsKitDbProperties.DbTablePrefix + "EntityTags", CmsKitDbProperties.DbSchema); b.ConfigureByConvention(); @@ -167,7 +158,7 @@ namespace Volo.CmsKit.EntityFrameworkCore { builder.Entity(b => { - b.ToTable(options.TablePrefix + "Pages", options.Schema); + b.ToTable(CmsKitDbProperties.DbTablePrefix + "Pages", CmsKitDbProperties.DbSchema); b.ConfigureByConvention(); @@ -189,7 +180,7 @@ namespace Volo.CmsKit.EntityFrameworkCore { builder.Entity(b => { - b.ToTable(options.TablePrefix + "Blogs", options.Schema); + b.ToTable(CmsKitDbProperties.DbTablePrefix + "Blogs", CmsKitDbProperties.DbSchema); b.ConfigureByConvention(); @@ -202,7 +193,7 @@ namespace Volo.CmsKit.EntityFrameworkCore builder.Entity(b => { - b.ToTable(options.TablePrefix + "BlogPosts", options.Schema); + b.ToTable(CmsKitDbProperties.DbTablePrefix + "BlogPosts", CmsKitDbProperties.DbSchema); b.ConfigureByConvention(); @@ -219,7 +210,7 @@ namespace Volo.CmsKit.EntityFrameworkCore builder.Entity(b => { - b.ToTable(options.TablePrefix + "BlogFeatures", options.Schema); + b.ToTable(CmsKitDbProperties.DbTablePrefix + "BlogFeatures", CmsKitDbProperties.DbSchema); b.ConfigureByConvention(); @@ -239,7 +230,7 @@ namespace Volo.CmsKit.EntityFrameworkCore { builder.Entity(b => { - b.ToTable(options.TablePrefix + "MediaDescriptors", options.Schema); + b.ToTable(CmsKitDbProperties.DbTablePrefix + "MediaDescriptors", CmsKitDbProperties.DbSchema); b.ConfigureByConvention(); @@ -260,7 +251,7 @@ namespace Volo.CmsKit.EntityFrameworkCore { builder.Entity(b => { - b.ToTable(options.TablePrefix + "MenuItems", options.Schema); + b.ToTable(CmsKitDbProperties.DbTablePrefix + "MenuItems", CmsKitDbProperties.DbSchema); b.ConfigureByConvention(); diff --git a/modules/cms-kit/src/Volo.CmsKit.EntityFrameworkCore/Volo/CmsKit/EntityFrameworkCore/CmsKitModelBuilderConfigurationOptions.cs b/modules/cms-kit/src/Volo.CmsKit.EntityFrameworkCore/Volo/CmsKit/EntityFrameworkCore/CmsKitModelBuilderConfigurationOptions.cs deleted file mode 100644 index c62b36792c..0000000000 --- a/modules/cms-kit/src/Volo.CmsKit.EntityFrameworkCore/Volo/CmsKit/EntityFrameworkCore/CmsKitModelBuilderConfigurationOptions.cs +++ /dev/null @@ -1,18 +0,0 @@ -using JetBrains.Annotations; -using Volo.Abp.EntityFrameworkCore.Modeling; - -namespace Volo.CmsKit.EntityFrameworkCore -{ - public class CmsKitModelBuilderConfigurationOptions : AbpModelBuilderConfigurationOptions - { - public CmsKitModelBuilderConfigurationOptions( - [NotNull] string tablePrefix = "", - [CanBeNull] string schema = null) - : base( - tablePrefix, - schema) - { - - } - } -} \ No newline at end of file diff --git a/modules/cms-kit/src/Volo.CmsKit.MongoDB/Volo/CmsKit/MongoDB/CmsKitMongoDbContextExtensions.cs b/modules/cms-kit/src/Volo.CmsKit.MongoDB/Volo/CmsKit/MongoDB/CmsKitMongoDbContextExtensions.cs index 9ff9ff8797..a7dbbda5c4 100644 --- a/modules/cms-kit/src/Volo.CmsKit.MongoDB/Volo/CmsKit/MongoDB/CmsKitMongoDbContextExtensions.cs +++ b/modules/cms-kit/src/Volo.CmsKit.MongoDB/Volo/CmsKit/MongoDB/CmsKitMongoDbContextExtensions.cs @@ -1,5 +1,4 @@ -using System; -using Volo.Abp; +using Volo.Abp; using Volo.Abp.MongoDB; using Volo.CmsKit.Blogs; using Volo.CmsKit.Comments; @@ -16,17 +15,10 @@ namespace Volo.CmsKit.MongoDB public static class CmsKitMongoDbContextExtensions { public static void ConfigureCmsKit( - this IMongoModelBuilder builder, - Action optionsAction = null) + this IMongoModelBuilder builder) { Check.NotNull(builder, nameof(builder)); - var options = new CmsKitMongoModelBuilderConfigurationOptions( - CmsKitDbProperties.DbTablePrefix - ); - - optionsAction?.Invoke(options); - builder.Entity(x => { x.CollectionName = CmsKitDbProperties.DbTablePrefix + "Users"; diff --git a/modules/cms-kit/src/Volo.CmsKit.MongoDB/Volo/CmsKit/MongoDB/CmsKitMongoModelBuilderConfigurationOptions.cs b/modules/cms-kit/src/Volo.CmsKit.MongoDB/Volo/CmsKit/MongoDB/CmsKitMongoModelBuilderConfigurationOptions.cs deleted file mode 100644 index 70f21e758f..0000000000 --- a/modules/cms-kit/src/Volo.CmsKit.MongoDB/Volo/CmsKit/MongoDB/CmsKitMongoModelBuilderConfigurationOptions.cs +++ /dev/null @@ -1,14 +0,0 @@ -using JetBrains.Annotations; -using Volo.Abp.MongoDB; - -namespace Volo.CmsKit.MongoDB -{ - public class CmsKitMongoModelBuilderConfigurationOptions : AbpMongoModelBuilderConfigurationOptions - { - public CmsKitMongoModelBuilderConfigurationOptions( - [NotNull] string collectionPrefix = "") - : base(collectionPrefix) - { - } - } -} \ No newline at end of file diff --git a/modules/docs/src/Volo.Docs.EntityFrameworkCore/Volo/Docs/EntityFrameworkCore/DocsDbContextModelBuilderExtensions.cs b/modules/docs/src/Volo.Docs.EntityFrameworkCore/Volo/Docs/EntityFrameworkCore/DocsDbContextModelBuilderExtensions.cs index 6f7c7d1a89..f3a5997048 100644 --- a/modules/docs/src/Volo.Docs.EntityFrameworkCore/Volo/Docs/EntityFrameworkCore/DocsDbContextModelBuilderExtensions.cs +++ b/modules/docs/src/Volo.Docs.EntityFrameworkCore/Volo/Docs/EntityFrameworkCore/DocsDbContextModelBuilderExtensions.cs @@ -1,5 +1,4 @@ -using System; -using JetBrains.Annotations; +using JetBrains.Annotations; using Microsoft.EntityFrameworkCore; using Volo.Abp; using Volo.Abp.EntityFrameworkCore.Modeling; @@ -11,8 +10,7 @@ namespace Volo.Docs.EntityFrameworkCore public static class DocsDbContextModelBuilderExtensions { public static void ConfigureDocs( - [NotNull] this ModelBuilder builder, - Action optionsAction = null) + [NotNull] this ModelBuilder builder) { Check.NotNull(builder, nameof(builder)); @@ -21,16 +19,9 @@ namespace Volo.Docs.EntityFrameworkCore return; } - var options = new DocsModelBuilderConfigurationOptions( - DocsDbProperties.DbTablePrefix, - DocsDbProperties.DbSchema - ); - - optionsAction?.Invoke(options); - builder.Entity(b => { - b.ToTable(options.TablePrefix + "Projects", options.Schema); + b.ToTable(DocsDbProperties.DbTablePrefix + "Projects", DocsDbProperties.DbSchema); b.ConfigureByConvention(); @@ -46,7 +37,7 @@ namespace Volo.Docs.EntityFrameworkCore builder.Entity(b => { - b.ToTable(options.TablePrefix + "Documents", options.Schema); + b.ToTable(DocsDbProperties.DbTablePrefix + "Documents", DocsDbProperties.DbSchema); b.ConfigureByConvention(); @@ -70,7 +61,7 @@ namespace Volo.Docs.EntityFrameworkCore builder.Entity(b => { - b.ToTable(options.TablePrefix + "DocumentContributors", options.Schema); + b.ToTable(DocsDbProperties.DbTablePrefix + "DocumentContributors", DocsDbProperties.DbSchema); b.ConfigureByConvention(); diff --git a/modules/docs/src/Volo.Docs.EntityFrameworkCore/Volo/Docs/EntityFrameworkCore/DocsModelBuilderConfigurationOptions.cs b/modules/docs/src/Volo.Docs.EntityFrameworkCore/Volo/Docs/EntityFrameworkCore/DocsModelBuilderConfigurationOptions.cs deleted file mode 100644 index 0baf8b4afe..0000000000 --- a/modules/docs/src/Volo.Docs.EntityFrameworkCore/Volo/Docs/EntityFrameworkCore/DocsModelBuilderConfigurationOptions.cs +++ /dev/null @@ -1,15 +0,0 @@ -using JetBrains.Annotations; -using Volo.Abp.EntityFrameworkCore.Modeling; - -namespace Volo.Docs.EntityFrameworkCore -{ - public class DocsModelBuilderConfigurationOptions : AbpModelBuilderConfigurationOptions - { - public DocsModelBuilderConfigurationOptions( - [NotNull] string tablePrefix, - [CanBeNull] string schema) - : base(tablePrefix, schema) - { - } - } -} \ No newline at end of file diff --git a/modules/docs/src/Volo.Docs.MongoDB/Volo/Docs/MongoDB/DocsMongoDbContextExtensions.cs b/modules/docs/src/Volo.Docs.MongoDB/Volo/Docs/MongoDB/DocsMongoDbContextExtensions.cs index c1645885d2..56d367c651 100644 --- a/modules/docs/src/Volo.Docs.MongoDB/Volo/Docs/MongoDB/DocsMongoDbContextExtensions.cs +++ b/modules/docs/src/Volo.Docs.MongoDB/Volo/Docs/MongoDB/DocsMongoDbContextExtensions.cs @@ -1,5 +1,4 @@ -using System; -using Volo.Abp; +using Volo.Abp; using Volo.Abp.MongoDB; using Volo.Docs.Documents; using Volo.Docs.Projects; @@ -9,25 +8,18 @@ namespace Volo.Docs.MongoDB public static class DocsMongoDbContextExtensions { public static void ConfigureDocs( - this IMongoModelBuilder builder, - Action optionsAction = null) + this IMongoModelBuilder builder) { Check.NotNull(builder, nameof(builder)); - var options = new DocsMongoModelBuilderConfigurationOptions( - DocsDbProperties.DbTablePrefix - ); - - optionsAction?.Invoke(options); - builder.Entity(b => { - b.CollectionName = options.CollectionPrefix + "Projects"; + b.CollectionName = DocsDbProperties.DbTablePrefix + "Projects"; }); builder.Entity(b => { - b.CollectionName = options.CollectionPrefix + "DocumentS"; + b.CollectionName = DocsDbProperties.DbTablePrefix + "DocumentS"; }); } } diff --git a/modules/docs/src/Volo.Docs.MongoDB/Volo/Docs/MongoDB/DocsMongoModelBuilderConfigurationOptions.cs b/modules/docs/src/Volo.Docs.MongoDB/Volo/Docs/MongoDB/DocsMongoModelBuilderConfigurationOptions.cs deleted file mode 100644 index 4bb1c76372..0000000000 --- a/modules/docs/src/Volo.Docs.MongoDB/Volo/Docs/MongoDB/DocsMongoModelBuilderConfigurationOptions.cs +++ /dev/null @@ -1,14 +0,0 @@ -using JetBrains.Annotations; -using Volo.Abp.MongoDB; - -namespace Volo.Docs.MongoDB -{ - public class DocsMongoModelBuilderConfigurationOptions : AbpMongoModelBuilderConfigurationOptions - { - public DocsMongoModelBuilderConfigurationOptions( - [NotNull] string collectionPrefix) - : base(collectionPrefix) - { - } - } -} diff --git a/modules/feature-management/src/Volo.Abp.FeatureManagement.EntityFrameworkCore/Volo/Abp/FeatureManagement/EntityFrameworkCore/FeatureManagementDbContextModelCreatingExtensions.cs b/modules/feature-management/src/Volo.Abp.FeatureManagement.EntityFrameworkCore/Volo/Abp/FeatureManagement/EntityFrameworkCore/FeatureManagementDbContextModelCreatingExtensions.cs index b482788e49..084e677214 100644 --- a/modules/feature-management/src/Volo.Abp.FeatureManagement.EntityFrameworkCore/Volo/Abp/FeatureManagement/EntityFrameworkCore/FeatureManagementDbContextModelCreatingExtensions.cs +++ b/modules/feature-management/src/Volo.Abp.FeatureManagement.EntityFrameworkCore/Volo/Abp/FeatureManagement/EntityFrameworkCore/FeatureManagementDbContextModelCreatingExtensions.cs @@ -7,8 +7,7 @@ namespace Volo.Abp.FeatureManagement.EntityFrameworkCore public static class FeatureManagementDbContextModelCreatingExtensions { public static void ConfigureFeatureManagement( - this ModelBuilder builder, - Action optionsAction = null) + this ModelBuilder builder) { Check.NotNull(builder, nameof(builder)); @@ -17,16 +16,9 @@ namespace Volo.Abp.FeatureManagement.EntityFrameworkCore return; } - var options = new FeatureManagementModelBuilderConfigurationOptions( - FeatureManagementDbProperties.DbTablePrefix, - FeatureManagementDbProperties.DbSchema - ); - - optionsAction?.Invoke(options); - builder.Entity(b => { - b.ToTable(options.TablePrefix + "FeatureValues", options.Schema); + b.ToTable(FeatureManagementDbProperties.DbTablePrefix + "FeatureValues", FeatureManagementDbProperties.DbSchema); b.ConfigureByConvention(); diff --git a/modules/feature-management/src/Volo.Abp.FeatureManagement.EntityFrameworkCore/Volo/Abp/FeatureManagement/EntityFrameworkCore/FeatureManagementModelBuilderConfigurationOptions.cs b/modules/feature-management/src/Volo.Abp.FeatureManagement.EntityFrameworkCore/Volo/Abp/FeatureManagement/EntityFrameworkCore/FeatureManagementModelBuilderConfigurationOptions.cs deleted file mode 100644 index ba8e38bd61..0000000000 --- a/modules/feature-management/src/Volo.Abp.FeatureManagement.EntityFrameworkCore/Volo/Abp/FeatureManagement/EntityFrameworkCore/FeatureManagementModelBuilderConfigurationOptions.cs +++ /dev/null @@ -1,18 +0,0 @@ -using JetBrains.Annotations; -using Volo.Abp.EntityFrameworkCore.Modeling; - -namespace Volo.Abp.FeatureManagement.EntityFrameworkCore -{ - public class FeatureManagementModelBuilderConfigurationOptions : AbpModelBuilderConfigurationOptions - { - public FeatureManagementModelBuilderConfigurationOptions( - [NotNull] string tablePrefix = "", - [CanBeNull] string schema = null) - : base( - tablePrefix, - schema) - { - - } - } -} \ No newline at end of file diff --git a/modules/feature-management/src/Volo.Abp.FeatureManagement.MongoDB/Volo/Abp/FeatureManagement/MongoDB/FeatureManagementMongoDbContextExtensions.cs b/modules/feature-management/src/Volo.Abp.FeatureManagement.MongoDB/Volo/Abp/FeatureManagement/MongoDB/FeatureManagementMongoDbContextExtensions.cs index 55ef3b616a..5988c1d57d 100644 --- a/modules/feature-management/src/Volo.Abp.FeatureManagement.MongoDB/Volo/Abp/FeatureManagement/MongoDB/FeatureManagementMongoDbContextExtensions.cs +++ b/modules/feature-management/src/Volo.Abp.FeatureManagement.MongoDB/Volo/Abp/FeatureManagement/MongoDB/FeatureManagementMongoDbContextExtensions.cs @@ -1,25 +1,17 @@ -using System; -using Volo.Abp.MongoDB; +using Volo.Abp.MongoDB; namespace Volo.Abp.FeatureManagement.MongoDB { public static class FeatureManagementMongoDbContextExtensions { public static void ConfigureFeatureManagement( - this IMongoModelBuilder builder, - Action optionsAction = null) + this IMongoModelBuilder builder) { Check.NotNull(builder, nameof(builder)); - var options = new FeatureManagementMongoModelBuilderConfigurationOptions( - FeatureManagementDbProperties.DbTablePrefix - ); - - optionsAction?.Invoke(options); - builder.Entity(b => { - b.CollectionName = options.CollectionPrefix + "FeatureValues"; + b.CollectionName = FeatureManagementDbProperties.DbTablePrefix + "FeatureValues"; }); } } diff --git a/modules/feature-management/src/Volo.Abp.FeatureManagement.MongoDB/Volo/Abp/FeatureManagement/MongoDB/FeatureManagementMongoModelBuilderConfigurationOptions.cs b/modules/feature-management/src/Volo.Abp.FeatureManagement.MongoDB/Volo/Abp/FeatureManagement/MongoDB/FeatureManagementMongoModelBuilderConfigurationOptions.cs deleted file mode 100644 index edb486e906..0000000000 --- a/modules/feature-management/src/Volo.Abp.FeatureManagement.MongoDB/Volo/Abp/FeatureManagement/MongoDB/FeatureManagementMongoModelBuilderConfigurationOptions.cs +++ /dev/null @@ -1,15 +0,0 @@ -using JetBrains.Annotations; -using Volo.Abp.MongoDB; - -namespace Volo.Abp.FeatureManagement.MongoDB -{ - public class FeatureManagementMongoModelBuilderConfigurationOptions : AbpMongoModelBuilderConfigurationOptions - { - public FeatureManagementMongoModelBuilderConfigurationOptions( - [NotNull] string collectionPrefix = "") - : base(collectionPrefix) - { - - } - } -} \ No newline at end of file diff --git a/modules/identityserver/src/Volo.Abp.IdentityServer.EntityFrameworkCore/Volo/Abp/IdentityServer/EntityFrameworkCore/IdentityServerDbContextModelCreatingExtensions.cs b/modules/identityserver/src/Volo.Abp.IdentityServer.EntityFrameworkCore/Volo/Abp/IdentityServer/EntityFrameworkCore/IdentityServerDbContextModelCreatingExtensions.cs index c8b0dc0682..27a609e97b 100644 --- a/modules/identityserver/src/Volo.Abp.IdentityServer.EntityFrameworkCore/Volo/Abp/IdentityServer/EntityFrameworkCore/IdentityServerDbContextModelCreatingExtensions.cs +++ b/modules/identityserver/src/Volo.Abp.IdentityServer.EntityFrameworkCore/Volo/Abp/IdentityServer/EntityFrameworkCore/IdentityServerDbContextModelCreatingExtensions.cs @@ -1,5 +1,4 @@ -using System; -using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore; using Volo.Abp.EntityFrameworkCore; using Volo.Abp.EntityFrameworkCore.Modeling; using Volo.Abp.IdentityServer.ApiResources; @@ -14,8 +13,7 @@ namespace Volo.Abp.IdentityServer.EntityFrameworkCore public static class IdentityServerDbContextModelCreatingExtensions { public static void ConfigureIdentityServer( - this ModelBuilder builder, - Action optionsAction = null) + this ModelBuilder builder) { Check.NotNull(builder, nameof(builder)); @@ -24,18 +22,11 @@ namespace Volo.Abp.IdentityServer.EntityFrameworkCore return; } - var options = new IdentityServerModelBuilderConfigurationOptions( - AbpIdentityServerDbProperties.DbTablePrefix, - AbpIdentityServerDbProperties.DbSchema - ); - - optionsAction?.Invoke(options); - #region Client builder.Entity(b => { - b.ToTable(options.TablePrefix + "Clients", options.Schema); + b.ToTable(AbpIdentityServerDbProperties.DbTablePrefix + "Clients", AbpIdentityServerDbProperties.DbSchema); b.ConfigureByConvention(); @@ -69,7 +60,7 @@ namespace Volo.Abp.IdentityServer.EntityFrameworkCore builder.Entity(b => { - b.ToTable(options.TablePrefix + "ClientGrantTypes", options.Schema); + b.ToTable(AbpIdentityServerDbProperties.DbTablePrefix + "ClientGrantTypes", AbpIdentityServerDbProperties.DbSchema); b.ConfigureByConvention(); @@ -82,7 +73,7 @@ namespace Volo.Abp.IdentityServer.EntityFrameworkCore builder.Entity(b => { - b.ToTable(options.TablePrefix + "ClientRedirectUris", options.Schema); + b.ToTable(AbpIdentityServerDbProperties.DbTablePrefix + "ClientRedirectUris", AbpIdentityServerDbProperties.DbSchema); b.ConfigureByConvention(); @@ -100,7 +91,7 @@ namespace Volo.Abp.IdentityServer.EntityFrameworkCore builder.Entity(b => { - b.ToTable(options.TablePrefix + "ClientPostLogoutRedirectUris", options.Schema); + b.ToTable(AbpIdentityServerDbProperties.DbTablePrefix + "ClientPostLogoutRedirectUris", AbpIdentityServerDbProperties.DbSchema); b.ConfigureByConvention(); @@ -120,7 +111,7 @@ namespace Volo.Abp.IdentityServer.EntityFrameworkCore builder.Entity(b => { - b.ToTable(options.TablePrefix + "ClientScopes", options.Schema); + b.ToTable(AbpIdentityServerDbProperties.DbTablePrefix + "ClientScopes", AbpIdentityServerDbProperties.DbSchema); b.ConfigureByConvention(); @@ -133,7 +124,7 @@ namespace Volo.Abp.IdentityServer.EntityFrameworkCore builder.Entity(b => { - b.ToTable(options.TablePrefix + "ClientSecrets", options.Schema); + b.ToTable(AbpIdentityServerDbProperties.DbTablePrefix + "ClientSecrets", AbpIdentityServerDbProperties.DbSchema); b.ConfigureByConvention(); @@ -152,7 +143,7 @@ namespace Volo.Abp.IdentityServer.EntityFrameworkCore builder.Entity(b => { - b.ToTable(options.TablePrefix + "ClientClaims", options.Schema); + b.ToTable(AbpIdentityServerDbProperties.DbTablePrefix + "ClientClaims", AbpIdentityServerDbProperties.DbSchema); b.ConfigureByConvention(); @@ -166,7 +157,7 @@ namespace Volo.Abp.IdentityServer.EntityFrameworkCore builder.Entity(b => { - b.ToTable(options.TablePrefix + "ClientIdPRestrictions", options.Schema); + b.ToTable(AbpIdentityServerDbProperties.DbTablePrefix + "ClientIdPRestrictions", AbpIdentityServerDbProperties.DbSchema); b.ConfigureByConvention(); @@ -179,7 +170,7 @@ namespace Volo.Abp.IdentityServer.EntityFrameworkCore builder.Entity(b => { - b.ToTable(options.TablePrefix + "ClientCorsOrigins", options.Schema); + b.ToTable(AbpIdentityServerDbProperties.DbTablePrefix + "ClientCorsOrigins", AbpIdentityServerDbProperties.DbSchema); b.ConfigureByConvention(); @@ -192,7 +183,7 @@ namespace Volo.Abp.IdentityServer.EntityFrameworkCore builder.Entity(b => { - b.ToTable(options.TablePrefix + "ClientProperties", options.Schema); + b.ToTable(AbpIdentityServerDbProperties.DbTablePrefix + "ClientProperties", AbpIdentityServerDbProperties.DbSchema); b.ConfigureByConvention(); @@ -214,7 +205,7 @@ namespace Volo.Abp.IdentityServer.EntityFrameworkCore builder.Entity(b => { - b.ToTable(options.TablePrefix + "IdentityResources", options.Schema); + b.ToTable(AbpIdentityServerDbProperties.DbTablePrefix + "IdentityResources", AbpIdentityServerDbProperties.DbSchema); b.ConfigureByConvention(); @@ -230,7 +221,7 @@ namespace Volo.Abp.IdentityServer.EntityFrameworkCore builder.Entity(b => { - b.ToTable(options.TablePrefix + "IdentityResourceClaims", options.Schema); + b.ToTable(AbpIdentityServerDbProperties.DbTablePrefix + "IdentityResourceClaims", AbpIdentityServerDbProperties.DbSchema); b.ConfigureByConvention(); @@ -243,7 +234,7 @@ namespace Volo.Abp.IdentityServer.EntityFrameworkCore builder.Entity(b => { - b.ToTable(options.TablePrefix + "IdentityResourceProperties", options.Schema); + b.ToTable(AbpIdentityServerDbProperties.DbTablePrefix + "IdentityResourceProperties", AbpIdentityServerDbProperties.DbSchema); b.ConfigureByConvention(); @@ -265,7 +256,7 @@ namespace Volo.Abp.IdentityServer.EntityFrameworkCore builder.Entity(b => { - b.ToTable(options.TablePrefix + "ApiResources", options.Schema); + b.ToTable(AbpIdentityServerDbProperties.DbTablePrefix + "ApiResources", AbpIdentityServerDbProperties.DbSchema); b.ConfigureByConvention(); @@ -284,7 +275,7 @@ namespace Volo.Abp.IdentityServer.EntityFrameworkCore builder.Entity(b => { - b.ToTable(options.TablePrefix + "ApiResourceSecrets", options.Schema); + b.ToTable(AbpIdentityServerDbProperties.DbTablePrefix + "ApiResourceSecrets", AbpIdentityServerDbProperties.DbSchema); b.ConfigureByConvention(); @@ -305,7 +296,7 @@ namespace Volo.Abp.IdentityServer.EntityFrameworkCore builder.Entity(b => { - b.ToTable(options.TablePrefix + "ApiResourceClaims", options.Schema); + b.ToTable(AbpIdentityServerDbProperties.DbTablePrefix + "ApiResourceClaims", AbpIdentityServerDbProperties.DbSchema); b.ConfigureByConvention(); @@ -318,7 +309,7 @@ namespace Volo.Abp.IdentityServer.EntityFrameworkCore builder.Entity(b => { - b.ToTable(options.TablePrefix + "ApiResourceScopes", options.Schema); + b.ToTable(AbpIdentityServerDbProperties.DbTablePrefix + "ApiResourceScopes", AbpIdentityServerDbProperties.DbSchema); b.ConfigureByConvention(); @@ -331,7 +322,7 @@ namespace Volo.Abp.IdentityServer.EntityFrameworkCore builder.Entity(b => { - b.ToTable(options.TablePrefix + "ApiResourceProperties", options.Schema); + b.ToTable(AbpIdentityServerDbProperties.DbTablePrefix + "ApiResourceProperties", AbpIdentityServerDbProperties.DbSchema); b.ConfigureByConvention(); @@ -353,7 +344,7 @@ namespace Volo.Abp.IdentityServer.EntityFrameworkCore builder.Entity(b => { - b.ToTable(options.TablePrefix + "ApiScopes", options.Schema); + b.ToTable(AbpIdentityServerDbProperties.DbTablePrefix + "ApiScopes", AbpIdentityServerDbProperties.DbSchema); b.ConfigureByConvention(); @@ -369,7 +360,7 @@ namespace Volo.Abp.IdentityServer.EntityFrameworkCore builder.Entity(b => { - b.ToTable(options.TablePrefix + "ApiScopeClaims", options.Schema); + b.ToTable(AbpIdentityServerDbProperties.DbTablePrefix + "ApiScopeClaims", AbpIdentityServerDbProperties.DbSchema); b.ConfigureByConvention(); @@ -382,7 +373,7 @@ namespace Volo.Abp.IdentityServer.EntityFrameworkCore builder.Entity(b => { - b.ToTable(options.TablePrefix + "ApiScopeProperties", options.Schema); + b.ToTable(AbpIdentityServerDbProperties.DbTablePrefix + "ApiScopeProperties", AbpIdentityServerDbProperties.DbSchema); b.ConfigureByConvention(); @@ -404,7 +395,7 @@ namespace Volo.Abp.IdentityServer.EntityFrameworkCore builder.Entity(b => { - b.ToTable(options.TablePrefix + "PersistedGrants", options.Schema); + b.ToTable(AbpIdentityServerDbProperties.DbTablePrefix + "PersistedGrants", AbpIdentityServerDbProperties.DbSchema); b.ConfigureByConvention(); @@ -438,7 +429,7 @@ namespace Volo.Abp.IdentityServer.EntityFrameworkCore builder.Entity(b => { - b.ToTable(options.TablePrefix + "DeviceFlowCodes", options.Schema); + b.ToTable(AbpIdentityServerDbProperties.DbTablePrefix + "DeviceFlowCodes", AbpIdentityServerDbProperties.DbSchema); b.ConfigureByConvention(); diff --git a/modules/identityserver/src/Volo.Abp.IdentityServer.EntityFrameworkCore/Volo/Abp/IdentityServer/EntityFrameworkCore/IdentityServerModelBuilderConfigurationOptions.cs b/modules/identityserver/src/Volo.Abp.IdentityServer.EntityFrameworkCore/Volo/Abp/IdentityServer/EntityFrameworkCore/IdentityServerModelBuilderConfigurationOptions.cs deleted file mode 100644 index 41a645bcd6..0000000000 --- a/modules/identityserver/src/Volo.Abp.IdentityServer.EntityFrameworkCore/Volo/Abp/IdentityServer/EntityFrameworkCore/IdentityServerModelBuilderConfigurationOptions.cs +++ /dev/null @@ -1,23 +0,0 @@ -using System; -using JetBrains.Annotations; -using Volo.Abp.EntityFrameworkCore; -using Volo.Abp.EntityFrameworkCore.Modeling; - -namespace Volo.Abp.IdentityServer.EntityFrameworkCore -{ - public class IdentityServerModelBuilderConfigurationOptions : AbpModelBuilderConfigurationOptions - { - [Obsolete("No need to manually set database provider after v2.9+. If it doesn't set automatically, use modelBuilder.UseXXX() in the OnModelCreating method of your DbContext (XXX is your database provider name).")] - public EfCoreDatabaseProvider? DatabaseProvider { get; set; } - - public IdentityServerModelBuilderConfigurationOptions( - [NotNull] string tablePrefix, - [CanBeNull] string schema) - : base( - tablePrefix, - schema) - { - - } - } -} \ No newline at end of file diff --git a/modules/identityserver/src/Volo.Abp.IdentityServer.MongoDB/Volo/Abp/IdentityServer/MongoDB/AbpIdentityServerMongoDbContextExtensions.cs b/modules/identityserver/src/Volo.Abp.IdentityServer.MongoDB/Volo/Abp/IdentityServer/MongoDB/AbpIdentityServerMongoDbContextExtensions.cs index 6abfc0618d..ea3d2e40c9 100644 --- a/modules/identityserver/src/Volo.Abp.IdentityServer.MongoDB/Volo/Abp/IdentityServer/MongoDB/AbpIdentityServerMongoDbContextExtensions.cs +++ b/modules/identityserver/src/Volo.Abp.IdentityServer.MongoDB/Volo/Abp/IdentityServer/MongoDB/AbpIdentityServerMongoDbContextExtensions.cs @@ -1,5 +1,4 @@ -using System; -using Volo.Abp.IdentityServer.ApiResources; +using Volo.Abp.IdentityServer.ApiResources; using Volo.Abp.IdentityServer.ApiScopes; using Volo.Abp.IdentityServer.Clients; using Volo.Abp.IdentityServer.Devices; @@ -12,45 +11,38 @@ namespace Volo.Abp.IdentityServer.MongoDB public static class AbpIdentityServerMongoDbContextExtensions { public static void ConfigureIdentityServer( - this IMongoModelBuilder builder, - Action optionsAction = null) + this IMongoModelBuilder builder) { Check.NotNull(builder, nameof(builder)); - var options = new IdentityServerMongoModelBuilderConfigurationOptions( - AbpIdentityServerDbProperties.DbTablePrefix - ); - - optionsAction?.Invoke(options); - builder.Entity(b => { - b.CollectionName = options.CollectionPrefix + "ApiResources"; + b.CollectionName = AbpIdentityServerDbProperties.DbTablePrefix + "ApiResources"; }); builder.Entity(b => { - b.CollectionName = options.CollectionPrefix + "ApiScopes"; + b.CollectionName = AbpIdentityServerDbProperties.DbTablePrefix + "ApiScopes"; }); builder.Entity(b => { - b.CollectionName = options.CollectionPrefix + "IdentityResources"; + b.CollectionName = AbpIdentityServerDbProperties.DbTablePrefix + "IdentityResources"; }); builder.Entity(b => { - b.CollectionName = options.CollectionPrefix + "Clients"; + b.CollectionName = AbpIdentityServerDbProperties.DbTablePrefix + "Clients"; }); builder.Entity(b => { - b.CollectionName = options.CollectionPrefix + "PersistedGrants"; + b.CollectionName = AbpIdentityServerDbProperties.DbTablePrefix + "PersistedGrants"; }); builder.Entity(b => { - b.CollectionName = options.CollectionPrefix + "DeviceFlowCodes"; + b.CollectionName = AbpIdentityServerDbProperties.DbTablePrefix + "DeviceFlowCodes"; }); } } diff --git a/modules/identityserver/src/Volo.Abp.IdentityServer.MongoDB/Volo/Abp/IdentityServer/MongoDB/IdentityServerMongoModelBuilderConfigurationOptions.cs b/modules/identityserver/src/Volo.Abp.IdentityServer.MongoDB/Volo/Abp/IdentityServer/MongoDB/IdentityServerMongoModelBuilderConfigurationOptions.cs deleted file mode 100644 index 55556e105b..0000000000 --- a/modules/identityserver/src/Volo.Abp.IdentityServer.MongoDB/Volo/Abp/IdentityServer/MongoDB/IdentityServerMongoModelBuilderConfigurationOptions.cs +++ /dev/null @@ -1,13 +0,0 @@ -using JetBrains.Annotations; -using Volo.Abp.MongoDB; - -namespace Volo.Abp.IdentityServer.MongoDB -{ - public class IdentityServerMongoModelBuilderConfigurationOptions : AbpMongoModelBuilderConfigurationOptions - { - public IdentityServerMongoModelBuilderConfigurationOptions([NotNull] string collectionPrefix = "") - : base(collectionPrefix) - { - } - } -} diff --git a/modules/permission-management/src/Volo.Abp.PermissionManagement.EntityFrameworkCore/Volo/Abp/PermissionManagement/EntityFrameworkCore/AbpPermissionManagementDbContextModelBuilderExtensions.cs b/modules/permission-management/src/Volo.Abp.PermissionManagement.EntityFrameworkCore/Volo/Abp/PermissionManagement/EntityFrameworkCore/AbpPermissionManagementDbContextModelBuilderExtensions.cs index 8810f4a0bc..100143e033 100644 --- a/modules/permission-management/src/Volo.Abp.PermissionManagement.EntityFrameworkCore/Volo/Abp/PermissionManagement/EntityFrameworkCore/AbpPermissionManagementDbContextModelBuilderExtensions.cs +++ b/modules/permission-management/src/Volo.Abp.PermissionManagement.EntityFrameworkCore/Volo/Abp/PermissionManagement/EntityFrameworkCore/AbpPermissionManagementDbContextModelBuilderExtensions.cs @@ -1,5 +1,4 @@ -using System; -using JetBrains.Annotations; +using JetBrains.Annotations; using Microsoft.EntityFrameworkCore; using Volo.Abp.EntityFrameworkCore.Modeling; @@ -8,21 +7,13 @@ namespace Volo.Abp.PermissionManagement.EntityFrameworkCore public static class AbpPermissionManagementDbContextModelBuilderExtensions { public static void ConfigurePermissionManagement( - [NotNull] this ModelBuilder builder, - [CanBeNull] Action optionsAction = null) + [NotNull] this ModelBuilder builder) { Check.NotNull(builder, nameof(builder)); - var options = new AbpPermissionManagementModelBuilderConfigurationOptions( - AbpPermissionManagementDbProperties.DbTablePrefix, - AbpPermissionManagementDbProperties.DbSchema - ); - - optionsAction?.Invoke(options); - builder.Entity(b => { - b.ToTable(options.TablePrefix + "PermissionGrants", options.Schema); + b.ToTable(AbpPermissionManagementDbProperties.DbTablePrefix + "PermissionGrants", AbpPermissionManagementDbProperties.DbSchema); b.ConfigureByConvention(); diff --git a/modules/permission-management/src/Volo.Abp.PermissionManagement.EntityFrameworkCore/Volo/Abp/PermissionManagement/EntityFrameworkCore/AbpPermissionManagementModelBuilderConfigurationOptions.cs b/modules/permission-management/src/Volo.Abp.PermissionManagement.EntityFrameworkCore/Volo/Abp/PermissionManagement/EntityFrameworkCore/AbpPermissionManagementModelBuilderConfigurationOptions.cs deleted file mode 100644 index 1ddfcc9a8f..0000000000 --- a/modules/permission-management/src/Volo.Abp.PermissionManagement.EntityFrameworkCore/Volo/Abp/PermissionManagement/EntityFrameworkCore/AbpPermissionManagementModelBuilderConfigurationOptions.cs +++ /dev/null @@ -1,18 +0,0 @@ -using JetBrains.Annotations; -using Volo.Abp.EntityFrameworkCore.Modeling; - -namespace Volo.Abp.PermissionManagement.EntityFrameworkCore -{ - public class AbpPermissionManagementModelBuilderConfigurationOptions : AbpModelBuilderConfigurationOptions - { - public AbpPermissionManagementModelBuilderConfigurationOptions( - [NotNull] string tablePrefix, - [CanBeNull] string schema) - : base( - tablePrefix, - schema) - { - - } - } -} \ No newline at end of file diff --git a/modules/permission-management/src/Volo.Abp.PermissionManagement.MongoDB/Volo/Abp/PermissionManagement/MongoDb/AbpPermissionManagementMongoDbContextExtensions.cs b/modules/permission-management/src/Volo.Abp.PermissionManagement.MongoDB/Volo/Abp/PermissionManagement/MongoDb/AbpPermissionManagementMongoDbContextExtensions.cs index cf81d69a19..7ed0a60d26 100644 --- a/modules/permission-management/src/Volo.Abp.PermissionManagement.MongoDB/Volo/Abp/PermissionManagement/MongoDb/AbpPermissionManagementMongoDbContextExtensions.cs +++ b/modules/permission-management/src/Volo.Abp.PermissionManagement.MongoDB/Volo/Abp/PermissionManagement/MongoDb/AbpPermissionManagementMongoDbContextExtensions.cs @@ -1,25 +1,17 @@ -using System; -using Volo.Abp.MongoDB; +using Volo.Abp.MongoDB; namespace Volo.Abp.PermissionManagement.MongoDB { public static class AbpPermissionManagementMongoDbContextExtensions { public static void ConfigurePermissionManagement( - this IMongoModelBuilder builder, - Action optionsAction = null) + this IMongoModelBuilder builder) { Check.NotNull(builder, nameof(builder)); - var options = new PermissionManagementMongoModelBuilderConfigurationOptions( - AbpPermissionManagementDbProperties.DbTablePrefix - ); - - optionsAction?.Invoke(options); - builder.Entity(b => { - b.CollectionName = options.CollectionPrefix + "PermissionGrants"; + b.CollectionName = AbpPermissionManagementDbProperties.DbTablePrefix + "PermissionGrants"; }); } } diff --git a/modules/permission-management/src/Volo.Abp.PermissionManagement.MongoDB/Volo/Abp/PermissionManagement/MongoDb/PermissionManagementMongoModelBuilderConfigurationOptions.cs b/modules/permission-management/src/Volo.Abp.PermissionManagement.MongoDB/Volo/Abp/PermissionManagement/MongoDb/PermissionManagementMongoModelBuilderConfigurationOptions.cs deleted file mode 100644 index acc7d5cb84..0000000000 --- a/modules/permission-management/src/Volo.Abp.PermissionManagement.MongoDB/Volo/Abp/PermissionManagement/MongoDb/PermissionManagementMongoModelBuilderConfigurationOptions.cs +++ /dev/null @@ -1,14 +0,0 @@ -using JetBrains.Annotations; -using Volo.Abp.MongoDB; - -namespace Volo.Abp.PermissionManagement.MongoDB -{ - public class PermissionManagementMongoModelBuilderConfigurationOptions : AbpMongoModelBuilderConfigurationOptions - { - public PermissionManagementMongoModelBuilderConfigurationOptions( - [NotNull] string tablePrefix = "") - : base(tablePrefix) - { - } - } -} \ No newline at end of file diff --git a/modules/setting-management/src/Volo.Abp.SettingManagement.EntityFrameworkCore/Volo/Abp/SettingManagement/EntityFrameworkCore/SettingManagementDbContextModelBuilderExtensions.cs b/modules/setting-management/src/Volo.Abp.SettingManagement.EntityFrameworkCore/Volo/Abp/SettingManagement/EntityFrameworkCore/SettingManagementDbContextModelBuilderExtensions.cs index 5e9f75eefa..aafc18f8de 100644 --- a/modules/setting-management/src/Volo.Abp.SettingManagement.EntityFrameworkCore/Volo/Abp/SettingManagement/EntityFrameworkCore/SettingManagementDbContextModelBuilderExtensions.cs +++ b/modules/setting-management/src/Volo.Abp.SettingManagement.EntityFrameworkCore/Volo/Abp/SettingManagement/EntityFrameworkCore/SettingManagementDbContextModelBuilderExtensions.cs @@ -1,29 +1,14 @@ -using System; -using JetBrains.Annotations; +using JetBrains.Annotations; using Microsoft.EntityFrameworkCore; using Volo.Abp.EntityFrameworkCore.Modeling; namespace Volo.Abp.SettingManagement.EntityFrameworkCore { - public class SettingManagementModelBuilderConfigurationOptions : AbpModelBuilderConfigurationOptions - { - public SettingManagementModelBuilderConfigurationOptions( - [NotNull] string tablePrefix, - [CanBeNull] string schema) - : base( - tablePrefix, - schema) - { - - } - } - public static class SettingManagementDbContextModelBuilderExtensions { //TODO: Instead of getting parameters, get a action of SettingManagementModelBuilderConfigurationOptions like other modules public static void ConfigureSettingManagement( - [NotNull] this ModelBuilder builder, - [CanBeNull] Action optionsAction = null) + [NotNull] this ModelBuilder builder) { Check.NotNull(builder, nameof(builder)); @@ -32,16 +17,9 @@ namespace Volo.Abp.SettingManagement.EntityFrameworkCore return; } - var options = new SettingManagementModelBuilderConfigurationOptions( - AbpSettingManagementDbProperties.DbTablePrefix, - AbpSettingManagementDbProperties.DbSchema - ); - - optionsAction?.Invoke(options); - builder.Entity(b => { - b.ToTable(options.TablePrefix + "Settings", options.Schema); + b.ToTable(AbpSettingManagementDbProperties.DbTablePrefix + "Settings", AbpSettingManagementDbProperties.DbSchema); b.ConfigureByConvention(); diff --git a/modules/setting-management/src/Volo.Abp.SettingManagement.MongoDB/Volo/Abp/SettingManagement/MongoDB/SettingManagementMongoDbContextExtensions.cs b/modules/setting-management/src/Volo.Abp.SettingManagement.MongoDB/Volo/Abp/SettingManagement/MongoDB/SettingManagementMongoDbContextExtensions.cs index 349341b5d3..71199ecd3e 100644 --- a/modules/setting-management/src/Volo.Abp.SettingManagement.MongoDB/Volo/Abp/SettingManagement/MongoDB/SettingManagementMongoDbContextExtensions.cs +++ b/modules/setting-management/src/Volo.Abp.SettingManagement.MongoDB/Volo/Abp/SettingManagement/MongoDB/SettingManagementMongoDbContextExtensions.cs @@ -1,4 +1,3 @@ -using System; using Volo.Abp.MongoDB; namespace Volo.Abp.SettingManagement.MongoDB @@ -6,20 +5,13 @@ namespace Volo.Abp.SettingManagement.MongoDB public static class SettingManagementMongoDbContextExtensions { public static void ConfigureSettingManagement( - this IMongoModelBuilder builder, - Action optionsAction = null) + this IMongoModelBuilder builder) { Check.NotNull(builder, nameof(builder)); - var options = new SettingManagementMongoModelBuilderConfigurationOptions( - AbpSettingManagementDbProperties.DbTablePrefix - ); - - optionsAction?.Invoke(options); - builder.Entity(b => { - b.CollectionName = options.CollectionPrefix + "Settings"; + b.CollectionName = AbpSettingManagementDbProperties.DbTablePrefix + "Settings"; }); } } diff --git a/modules/setting-management/src/Volo.Abp.SettingManagement.MongoDB/Volo/Abp/SettingManagement/MongoDB/SettingManagementMongoModelBuilderConfigurationOptions.cs b/modules/setting-management/src/Volo.Abp.SettingManagement.MongoDB/Volo/Abp/SettingManagement/MongoDB/SettingManagementMongoModelBuilderConfigurationOptions.cs deleted file mode 100644 index bdc423f8a1..0000000000 --- a/modules/setting-management/src/Volo.Abp.SettingManagement.MongoDB/Volo/Abp/SettingManagement/MongoDB/SettingManagementMongoModelBuilderConfigurationOptions.cs +++ /dev/null @@ -1,14 +0,0 @@ -using JetBrains.Annotations; -using Volo.Abp.MongoDB; - -namespace Volo.Abp.SettingManagement.MongoDB -{ - public class SettingManagementMongoModelBuilderConfigurationOptions : AbpMongoModelBuilderConfigurationOptions - { - public SettingManagementMongoModelBuilderConfigurationOptions( - [NotNull] string tablePrefix = "") - : base(tablePrefix) - { - } - } -} \ No newline at end of file diff --git a/modules/tenant-management/src/Volo.Abp.TenantManagement.EntityFrameworkCore/Volo/Abp/TenantManagement/EntityFrameworkCore/AbpTenantManagementDbContextModelCreatingExtensions.cs b/modules/tenant-management/src/Volo.Abp.TenantManagement.EntityFrameworkCore/Volo/Abp/TenantManagement/EntityFrameworkCore/AbpTenantManagementDbContextModelCreatingExtensions.cs index 398dc66fe5..95364c3901 100644 --- a/modules/tenant-management/src/Volo.Abp.TenantManagement.EntityFrameworkCore/Volo/Abp/TenantManagement/EntityFrameworkCore/AbpTenantManagementDbContextModelCreatingExtensions.cs +++ b/modules/tenant-management/src/Volo.Abp.TenantManagement.EntityFrameworkCore/Volo/Abp/TenantManagement/EntityFrameworkCore/AbpTenantManagementDbContextModelCreatingExtensions.cs @@ -1,4 +1,3 @@ -using System; using JetBrains.Annotations; using Microsoft.EntityFrameworkCore; using Volo.Abp.EntityFrameworkCore.Modeling; @@ -8,8 +7,7 @@ namespace Volo.Abp.TenantManagement.EntityFrameworkCore public static class AbpTenantManagementDbContextModelCreatingExtensions { public static void ConfigureTenantManagement( - this ModelBuilder builder, - [CanBeNull] Action optionsAction = null) + this ModelBuilder builder) { Check.NotNull(builder, nameof(builder)); @@ -18,16 +16,9 @@ namespace Volo.Abp.TenantManagement.EntityFrameworkCore return; } - var options = new AbpTenantManagementModelBuilderConfigurationOptions( - AbpTenantManagementDbProperties.DbTablePrefix, - AbpTenantManagementDbProperties.DbSchema - ); - - optionsAction?.Invoke(options); - builder.Entity(b => { - b.ToTable(options.TablePrefix + "Tenants", options.Schema); + b.ToTable(AbpTenantManagementDbProperties.DbTablePrefix + "Tenants", AbpTenantManagementDbProperties.DbSchema); b.ConfigureByConvention(); @@ -42,7 +33,7 @@ namespace Volo.Abp.TenantManagement.EntityFrameworkCore builder.Entity(b => { - b.ToTable(options.TablePrefix + "TenantConnectionStrings", options.Schema); + b.ToTable(AbpTenantManagementDbProperties.DbTablePrefix + "TenantConnectionStrings", AbpTenantManagementDbProperties.DbSchema); b.ConfigureByConvention(); diff --git a/modules/tenant-management/src/Volo.Abp.TenantManagement.EntityFrameworkCore/Volo/Abp/TenantManagement/EntityFrameworkCore/AbpTenantManagementModelBuilderConfigurationOptions.cs b/modules/tenant-management/src/Volo.Abp.TenantManagement.EntityFrameworkCore/Volo/Abp/TenantManagement/EntityFrameworkCore/AbpTenantManagementModelBuilderConfigurationOptions.cs deleted file mode 100644 index 849ed68bae..0000000000 --- a/modules/tenant-management/src/Volo.Abp.TenantManagement.EntityFrameworkCore/Volo/Abp/TenantManagement/EntityFrameworkCore/AbpTenantManagementModelBuilderConfigurationOptions.cs +++ /dev/null @@ -1,18 +0,0 @@ -using JetBrains.Annotations; -using Volo.Abp.EntityFrameworkCore.Modeling; - -namespace Volo.Abp.TenantManagement.EntityFrameworkCore -{ - public class AbpTenantManagementModelBuilderConfigurationOptions : AbpModelBuilderConfigurationOptions - { - public AbpTenantManagementModelBuilderConfigurationOptions( - [NotNull] string tablePrefix, - [CanBeNull] string schema) - : base( - tablePrefix, - schema) - { - - } - } -} \ No newline at end of file diff --git a/modules/tenant-management/src/Volo.Abp.TenantManagement.MongoDB/Volo/Abp/TenantManagement/MongoDb/AbpTenantManagementMongoDbContextExtensions.cs b/modules/tenant-management/src/Volo.Abp.TenantManagement.MongoDB/Volo/Abp/TenantManagement/MongoDb/AbpTenantManagementMongoDbContextExtensions.cs index 18b2049450..92f6db2d95 100644 --- a/modules/tenant-management/src/Volo.Abp.TenantManagement.MongoDB/Volo/Abp/TenantManagement/MongoDb/AbpTenantManagementMongoDbContextExtensions.cs +++ b/modules/tenant-management/src/Volo.Abp.TenantManagement.MongoDB/Volo/Abp/TenantManagement/MongoDb/AbpTenantManagementMongoDbContextExtensions.cs @@ -1,25 +1,17 @@ -using System; -using Volo.Abp.MongoDB; +using Volo.Abp.MongoDB; namespace Volo.Abp.TenantManagement.MongoDB { public static class AbpTenantManagementMongoDbContextExtensions { public static void ConfigureTenantManagement( - this IMongoModelBuilder builder, - Action optionsAction = null) + this IMongoModelBuilder builder) { Check.NotNull(builder, nameof(builder)); - var options = new TenantManagementMongoModelBuilderConfigurationOptions( - AbpTenantManagementDbProperties.DbTablePrefix - ); - - optionsAction?.Invoke(options); - builder.Entity(b => { - b.CollectionName = options.CollectionPrefix + "Tenants"; + b.CollectionName = AbpTenantManagementDbProperties.DbTablePrefix + "Tenants"; }); } } diff --git a/modules/tenant-management/src/Volo.Abp.TenantManagement.MongoDB/Volo/Abp/TenantManagement/MongoDb/TenantManagementMongoModelBuilderConfigurationOptions.cs b/modules/tenant-management/src/Volo.Abp.TenantManagement.MongoDB/Volo/Abp/TenantManagement/MongoDb/TenantManagementMongoModelBuilderConfigurationOptions.cs deleted file mode 100644 index 09f54572b2..0000000000 --- a/modules/tenant-management/src/Volo.Abp.TenantManagement.MongoDB/Volo/Abp/TenantManagement/MongoDb/TenantManagementMongoModelBuilderConfigurationOptions.cs +++ /dev/null @@ -1,14 +0,0 @@ -using JetBrains.Annotations; -using Volo.Abp.MongoDB; - -namespace Volo.Abp.TenantManagement.MongoDB -{ - public class TenantManagementMongoModelBuilderConfigurationOptions : AbpMongoModelBuilderConfigurationOptions - { - public TenantManagementMongoModelBuilderConfigurationOptions( - [NotNull] string tablePrefix = "") - : base(tablePrefix) - { - } - } -} \ No newline at end of file From 157fb66f45c8bbaa20a7abfa3ea7b57aa99274d4 Mon Sep 17 00:00:00 2001 From: liangshiwei Date: Tue, 21 Sep 2021 15:45:52 +0800 Subject: [PATCH 2/3] Update IdentityServerDbContextModelCreatingExtensions.cs --- ...yServerDbContextModelCreatingExtensions.cs | 24 +++++++++---------- 1 file changed, 11 insertions(+), 13 deletions(-) diff --git a/modules/identityserver/src/Volo.Abp.IdentityServer.EntityFrameworkCore/Volo/Abp/IdentityServer/EntityFrameworkCore/IdentityServerDbContextModelCreatingExtensions.cs b/modules/identityserver/src/Volo.Abp.IdentityServer.EntityFrameworkCore/Volo/Abp/IdentityServer/EntityFrameworkCore/IdentityServerDbContextModelCreatingExtensions.cs index 27a609e97b..609ebebf2c 100644 --- a/modules/identityserver/src/Volo.Abp.IdentityServer.EntityFrameworkCore/Volo/Abp/IdentityServer/EntityFrameworkCore/IdentityServerDbContextModelCreatingExtensions.cs +++ b/modules/identityserver/src/Volo.Abp.IdentityServer.EntityFrameworkCore/Volo/Abp/IdentityServer/EntityFrameworkCore/IdentityServerDbContextModelCreatingExtensions.cs @@ -79,7 +79,7 @@ namespace Volo.Abp.IdentityServer.EntityFrameworkCore b.HasKey(x => new {x.ClientId, x.RedirectUri}); - if (IsDatabaseProvider(builder, options, EfCoreDatabaseProvider.MySql)) + if (IsDatabaseProvider(builder, EfCoreDatabaseProvider.MySql)) { ClientRedirectUriConsts.RedirectUriMaxLengthValue = 300; } @@ -97,7 +97,7 @@ namespace Volo.Abp.IdentityServer.EntityFrameworkCore b.HasKey(x => new {x.ClientId, x.PostLogoutRedirectUri}); - if (IsDatabaseProvider(builder, options, EfCoreDatabaseProvider.MySql)) + if (IsDatabaseProvider(builder, EfCoreDatabaseProvider.MySql)) { ClientPostLogoutRedirectUriConsts.PostLogoutRedirectUriMaxLengthValue = 300; } @@ -131,7 +131,7 @@ namespace Volo.Abp.IdentityServer.EntityFrameworkCore b.HasKey(x => new {x.ClientId, x.Type, x.Value}); b.Property(x => x.Type).HasMaxLength(ClientSecretConsts.TypeMaxLength).IsRequired(); - if (IsDatabaseProvider(builder, options, EfCoreDatabaseProvider.MySql, EfCoreDatabaseProvider.Oracle)) + if (IsDatabaseProvider(builder, EfCoreDatabaseProvider.MySql, EfCoreDatabaseProvider.Oracle)) { ClientSecretConsts.ValueMaxLength = 300; } @@ -190,7 +190,7 @@ namespace Volo.Abp.IdentityServer.EntityFrameworkCore b.HasKey(x => new {x.ClientId, x.Key, x.Value}); b.Property(x => x.Key).HasMaxLength(ClientPropertyConsts.KeyMaxLength).IsRequired(); - if (IsDatabaseProvider(builder, options, EfCoreDatabaseProvider.MySql)) + if (IsDatabaseProvider(builder, EfCoreDatabaseProvider.MySql)) { ClientPropertyConsts.ValueMaxLength = 300; } @@ -241,7 +241,7 @@ namespace Volo.Abp.IdentityServer.EntityFrameworkCore b.HasKey(x => new {x.IdentityResourceId, x.Key, x.Value}); b.Property(x => x.Key).HasMaxLength(IdentityResourcePropertyConsts.KeyMaxLength).IsRequired(); - if (IsDatabaseProvider(builder, options, EfCoreDatabaseProvider.MySql, EfCoreDatabaseProvider.Oracle)) + if (IsDatabaseProvider(builder, EfCoreDatabaseProvider.MySql, EfCoreDatabaseProvider.Oracle)) { IdentityResourcePropertyConsts.ValueMaxLength = 300; } @@ -283,7 +283,7 @@ namespace Volo.Abp.IdentityServer.EntityFrameworkCore b.Property(x => x.Type).HasMaxLength(ApiResourceSecretConsts.TypeMaxLength).IsRequired(); - if (IsDatabaseProvider(builder, options, EfCoreDatabaseProvider.MySql, EfCoreDatabaseProvider.Oracle)) + if (IsDatabaseProvider(builder, EfCoreDatabaseProvider.MySql, EfCoreDatabaseProvider.Oracle)) { ApiResourceSecretConsts.ValueMaxLength = 300; } @@ -329,7 +329,7 @@ namespace Volo.Abp.IdentityServer.EntityFrameworkCore b.HasKey(x => new {x.ApiResourceId, x.Key, x.Value}); b.Property(x => x.Key).HasMaxLength(ApiResourcePropertyConsts.KeyMaxLength).IsRequired(); - if (IsDatabaseProvider(builder, options, EfCoreDatabaseProvider.MySql, EfCoreDatabaseProvider.Oracle)) + if (IsDatabaseProvider(builder, EfCoreDatabaseProvider.MySql, EfCoreDatabaseProvider.Oracle)) { ApiResourcePropertyConsts.ValueMaxLength = 300; } @@ -380,7 +380,7 @@ namespace Volo.Abp.IdentityServer.EntityFrameworkCore b.HasKey(x => new {x.ApiScopeId, x.Key, x.Value}); b.Property(x => x.Key).HasMaxLength(ApiScopePropertyConsts.KeyMaxLength).IsRequired(); - if (IsDatabaseProvider(builder, options, EfCoreDatabaseProvider.MySql, EfCoreDatabaseProvider.Oracle)) + if (IsDatabaseProvider(builder, EfCoreDatabaseProvider.MySql, EfCoreDatabaseProvider.Oracle)) { ApiScopePropertyConsts.ValueMaxLength = 300; } @@ -407,7 +407,7 @@ namespace Volo.Abp.IdentityServer.EntityFrameworkCore b.Property(x => x.Description).HasMaxLength(PersistedGrantConsts.DescriptionMaxLength); b.Property(x => x.CreationTime).IsRequired(); - if (IsDatabaseProvider(builder, options, EfCoreDatabaseProvider.MySql)) + if (IsDatabaseProvider(builder, EfCoreDatabaseProvider.MySql)) { PersistedGrantConsts.DataMaxLengthValue = 10000; //TODO: MySQL accepts 20.000. We can consider to change in v3.0. } @@ -442,7 +442,7 @@ namespace Volo.Abp.IdentityServer.EntityFrameworkCore b.Property(x => x.CreationTime).IsRequired(); b.Property(x => x.Expiration).IsRequired(); - if (IsDatabaseProvider(builder, options, EfCoreDatabaseProvider.MySql)) + if (IsDatabaseProvider(builder, EfCoreDatabaseProvider.MySql)) { DeviceFlowCodesConsts.DataMaxLength = 10000; //TODO: MySQL accepts 20.000. We can consider to change in v3.0. } @@ -462,13 +462,11 @@ namespace Volo.Abp.IdentityServer.EntityFrameworkCore private static bool IsDatabaseProvider( ModelBuilder modelBuilder, - IdentityServerModelBuilderConfigurationOptions options, params EfCoreDatabaseProvider[] providers) { foreach (var provider in providers) { - if (options.DatabaseProvider == EfCoreDatabaseProvider.MySql || - modelBuilder.GetDatabaseProvider() == provider) + if (modelBuilder.GetDatabaseProvider() == provider) { return true; } From a30dc3b1ccb0e303c2f2208ce75ecedecf932728 Mon Sep 17 00:00:00 2001 From: liangshiwei Date: Tue, 21 Sep 2021 16:17:26 +0800 Subject: [PATCH 3/3] Remove ModelBuilderConfigurationOptions of module template --- ...ectNameDbContextModelCreatingExtensions.cs | 23 ++++++------------- ...ectNameModelBuilderConfigurationOptions.cs | 18 --------------- .../MyProjectNameMongoDbContextExtensions.cs | 14 +++-------- ...meMongoModelBuilderConfigurationOptions.cs | 14 ----------- 4 files changed, 10 insertions(+), 59 deletions(-) delete mode 100644 templates/module/aspnet-core/src/MyCompanyName.MyProjectName.EntityFrameworkCore/EntityFrameworkCore/MyProjectNameModelBuilderConfigurationOptions.cs delete mode 100644 templates/module/aspnet-core/src/MyCompanyName.MyProjectName.MongoDB/MongoDB/MyProjectNameMongoModelBuilderConfigurationOptions.cs diff --git a/templates/module/aspnet-core/src/MyCompanyName.MyProjectName.EntityFrameworkCore/EntityFrameworkCore/MyProjectNameDbContextModelCreatingExtensions.cs b/templates/module/aspnet-core/src/MyCompanyName.MyProjectName.EntityFrameworkCore/EntityFrameworkCore/MyProjectNameDbContextModelCreatingExtensions.cs index 0e1e01628d..d8489151e4 100644 --- a/templates/module/aspnet-core/src/MyCompanyName.MyProjectName.EntityFrameworkCore/EntityFrameworkCore/MyProjectNameDbContextModelCreatingExtensions.cs +++ b/templates/module/aspnet-core/src/MyCompanyName.MyProjectName.EntityFrameworkCore/EntityFrameworkCore/MyProjectNameDbContextModelCreatingExtensions.cs @@ -1,5 +1,4 @@ -using System; -using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore; using Volo.Abp; namespace MyCompanyName.MyProjectName.EntityFrameworkCore @@ -7,30 +6,22 @@ namespace MyCompanyName.MyProjectName.EntityFrameworkCore public static class MyProjectNameDbContextModelCreatingExtensions { public static void ConfigureMyProjectName( - this ModelBuilder builder, - Action optionsAction = null) + this ModelBuilder builder) { Check.NotNull(builder, nameof(builder)); - var options = new MyProjectNameModelBuilderConfigurationOptions( - MyProjectNameDbProperties.DbTablePrefix, - MyProjectNameDbProperties.DbSchema - ); - - optionsAction?.Invoke(options); - /* Configure all entities here. Example: builder.Entity(b => { //Configure table & schema name - b.ToTable(options.TablePrefix + "Questions", options.Schema); - + b.ToTable(MyProjectNameDbProperties.DbTablePrefix + "Questions", MyProjectNameDbProperties.DbSchema); + b.ConfigureByConvention(); - + //Properties b.Property(q => q.Title).IsRequired().HasMaxLength(QuestionConsts.MaxTitleLength); - + //Relations b.HasMany(question => question.Tags).WithOne().HasForeignKey(qt => qt.QuestionId); @@ -40,4 +31,4 @@ namespace MyCompanyName.MyProjectName.EntityFrameworkCore */ } } -} \ No newline at end of file +} diff --git a/templates/module/aspnet-core/src/MyCompanyName.MyProjectName.EntityFrameworkCore/EntityFrameworkCore/MyProjectNameModelBuilderConfigurationOptions.cs b/templates/module/aspnet-core/src/MyCompanyName.MyProjectName.EntityFrameworkCore/EntityFrameworkCore/MyProjectNameModelBuilderConfigurationOptions.cs deleted file mode 100644 index 8b3c2a49dd..0000000000 --- a/templates/module/aspnet-core/src/MyCompanyName.MyProjectName.EntityFrameworkCore/EntityFrameworkCore/MyProjectNameModelBuilderConfigurationOptions.cs +++ /dev/null @@ -1,18 +0,0 @@ -using JetBrains.Annotations; -using Volo.Abp.EntityFrameworkCore.Modeling; - -namespace MyCompanyName.MyProjectName.EntityFrameworkCore -{ - public class MyProjectNameModelBuilderConfigurationOptions : AbpModelBuilderConfigurationOptions - { - public MyProjectNameModelBuilderConfigurationOptions( - [NotNull] string tablePrefix = "", - [CanBeNull] string schema = null) - : base( - tablePrefix, - schema) - { - - } - } -} \ No newline at end of file diff --git a/templates/module/aspnet-core/src/MyCompanyName.MyProjectName.MongoDB/MongoDB/MyProjectNameMongoDbContextExtensions.cs b/templates/module/aspnet-core/src/MyCompanyName.MyProjectName.MongoDB/MongoDB/MyProjectNameMongoDbContextExtensions.cs index 4dca336b5e..a66e949d4e 100644 --- a/templates/module/aspnet-core/src/MyCompanyName.MyProjectName.MongoDB/MongoDB/MyProjectNameMongoDbContextExtensions.cs +++ b/templates/module/aspnet-core/src/MyCompanyName.MyProjectName.MongoDB/MongoDB/MyProjectNameMongoDbContextExtensions.cs @@ -1,5 +1,4 @@ -using System; -using Volo.Abp; +using Volo.Abp; using Volo.Abp.MongoDB; namespace MyCompanyName.MyProjectName.MongoDB @@ -7,16 +6,9 @@ namespace MyCompanyName.MyProjectName.MongoDB public static class MyProjectNameMongoDbContextExtensions { public static void ConfigureMyProjectName( - this IMongoModelBuilder builder, - Action optionsAction = null) + this IMongoModelBuilder builder) { Check.NotNull(builder, nameof(builder)); - - var options = new MyProjectNameMongoModelBuilderConfigurationOptions( - MyProjectNameDbProperties.DbTablePrefix - ); - - optionsAction?.Invoke(options); } } -} \ No newline at end of file +} diff --git a/templates/module/aspnet-core/src/MyCompanyName.MyProjectName.MongoDB/MongoDB/MyProjectNameMongoModelBuilderConfigurationOptions.cs b/templates/module/aspnet-core/src/MyCompanyName.MyProjectName.MongoDB/MongoDB/MyProjectNameMongoModelBuilderConfigurationOptions.cs deleted file mode 100644 index c40728fefa..0000000000 --- a/templates/module/aspnet-core/src/MyCompanyName.MyProjectName.MongoDB/MongoDB/MyProjectNameMongoModelBuilderConfigurationOptions.cs +++ /dev/null @@ -1,14 +0,0 @@ -using JetBrains.Annotations; -using Volo.Abp.MongoDB; - -namespace MyCompanyName.MyProjectName.MongoDB -{ - public class MyProjectNameMongoModelBuilderConfigurationOptions : AbpMongoModelBuilderConfigurationOptions - { - public MyProjectNameMongoModelBuilderConfigurationOptions( - [NotNull] string collectionPrefix = "") - : base(collectionPrefix) - { - } - } -} \ No newline at end of file