Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove ModelBuilderConfigurationOptions of all modules #10087

Merged
merged 3 commits into from
Sep 21, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -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<AbpAuditLoggingModelBuilderConfigurationOptions> optionsAction = null)
[NotNull] this ModelBuilder builder)
{
Check.NotNull(builder, nameof(builder));

var options = new AbpAuditLoggingModelBuilderConfigurationOptions(
AbpAuditLoggingDbProperties.DbTablePrefix,
AbpAuditLoggingDbProperties.DbSchema
);

optionsAction?.Invoke(options);

builder.Entity<AuditLog>(b =>
{
b.ToTable(options.TablePrefix + "AuditLogs", options.Schema);
b.ToTable(AbpAuditLoggingDbProperties.DbTablePrefix + "AuditLogs", AbpAuditLoggingDbProperties.DbSchema);

b.ConfigureByConvention();

Expand Down Expand Up @@ -56,7 +46,7 @@ public static class AbpAuditLoggingDbContextModelBuilderExtensions

builder.Entity<AuditLogAction>(b =>
{
b.ToTable(options.TablePrefix + "AuditLogActions", options.Schema);
b.ToTable(AbpAuditLoggingDbProperties.DbTablePrefix + "AuditLogActions", AbpAuditLoggingDbProperties.DbSchema);

b.ConfigureByConvention();

Expand All @@ -75,7 +65,7 @@ public static class AbpAuditLoggingDbContextModelBuilderExtensions

builder.Entity<EntityChange>(b =>
{
b.ToTable(options.TablePrefix + "EntityChanges", options.Schema);
b.ToTable(AbpAuditLoggingDbProperties.DbTablePrefix + "EntityChanges", AbpAuditLoggingDbProperties.DbSchema);

b.ConfigureByConvention();

Expand All @@ -96,7 +86,7 @@ public static class AbpAuditLoggingDbContextModelBuilderExtensions

builder.Entity<EntityPropertyChange>(b =>
{
b.ToTable(options.TablePrefix + "EntityPropertyChanges", options.Schema);
b.ToTable(AbpAuditLoggingDbProperties.DbTablePrefix + "EntityPropertyChanges", AbpAuditLoggingDbProperties.DbSchema);

b.ConfigureByConvention();

Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -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<AuditLoggingMongoModelBuilderConfigurationOptions> optionsAction = null)
this IMongoModelBuilder builder)
{
Check.NotNull(builder, nameof(builder));

var options = new AuditLoggingMongoModelBuilderConfigurationOptions(
AbpAuditLoggingDbProperties.DbTablePrefix
);

optionsAction?.Invoke(options);

builder.Entity<AuditLog>(b =>
{
b.CollectionName = options.CollectionPrefix + "AuditLogs";
b.CollectionName = AbpAuditLoggingDbProperties.DbTablePrefix + "AuditLogs";
});
}
}
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,7 @@ namespace Volo.Abp.BackgroundJobs.EntityFrameworkCore
public static class BackgroundJobsDbContextModelCreatingExtensions
{
public static void ConfigureBackgroundJobs(
this ModelBuilder builder,
Action<BackgroundJobsModelBuilderConfigurationOptions> optionsAction = null)
this ModelBuilder builder)
{
Check.NotNull(builder, nameof(builder));

Expand All @@ -17,16 +16,9 @@ public static class BackgroundJobsDbContextModelCreatingExtensions
return;
}

var options = new BackgroundJobsModelBuilderConfigurationOptions(
BackgroundJobsDbProperties.DbTablePrefix,
BackgroundJobsDbProperties.DbSchema
);

optionsAction?.Invoke(options);

builder.Entity<BackgroundJobRecord>(b =>
{
b.ToTable(options.TablePrefix + "BackgroundJobs", options.Schema);
b.ToTable(BackgroundJobsDbProperties.DbTablePrefix + "BackgroundJobs", BackgroundJobsDbProperties.DbSchema);

b.ConfigureByConvention();

Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -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<AbpMongoModelBuilderConfigurationOptions> optionsAction = null)
this IMongoModelBuilder builder)
{
Check.NotNull(builder, nameof(builder));

var options = new BackgroundJobsMongoModelBuilderConfigurationOptions(
BackgroundJobsDbProperties.DbTablePrefix
);

optionsAction?.Invoke(options);

builder.Entity<BackgroundJobRecord>(b =>
{
b.CollectionName = options.CollectionPrefix + "BackgroundJobs";
b.CollectionName = BackgroundJobsDbProperties.DbTablePrefix + "BackgroundJobs";
});
}
}
}
}

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,27 +1,18 @@
using Microsoft.EntityFrameworkCore;
using System;
using Volo.Abp.EntityFrameworkCore.Modeling;

namespace Volo.Abp.BlobStoring.Database.EntityFrameworkCore
{
public static class BlobStoringDbContextModelCreatingExtensions
{
public static void ConfigureBlobStoring(
this ModelBuilder builder,
Action<BlobStoringModelBuilderConfigurationOptions> optionsAction = null)
this ModelBuilder builder)
{
Check.NotNull(builder, nameof(builder));

var options = new BlobStoringModelBuilderConfigurationOptions(
BlobStoringDatabaseDbProperties.DbTablePrefix,
BlobStoringDatabaseDbProperties.DbSchema
);

optionsAction?.Invoke(options);

builder.Entity<DatabaseBlobContainer>(b =>
{
b.ToTable(options.TablePrefix + "BlobContainers", options.Schema);
b.ToTable(BlobStoringDatabaseDbProperties.DbTablePrefix + "BlobContainers", BlobStoringDatabaseDbProperties.DbSchema);

b.ConfigureByConvention();

Expand All @@ -36,7 +27,7 @@ public static class BlobStoringDbContextModelCreatingExtensions

builder.Entity<DatabaseBlob>(b =>
{
b.ToTable(options.TablePrefix + "Blobs", options.Schema);
b.ToTable(BlobStoringDatabaseDbProperties.DbTablePrefix + "Blobs", BlobStoringDatabaseDbProperties.DbSchema);

b.ConfigureByConvention();

Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -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<AbpMongoModelBuilderConfigurationOptions> optionsAction = null)
this IMongoModelBuilder builder)
{
Check.NotNull(builder, nameof(builder));

var options = new BlobStoringMongoModelBuilderConfigurationOptions(
BlobStoringDatabaseDbProperties.DbTablePrefix
);

optionsAction?.Invoke(options);

builder.Entity<DatabaseBlobContainer>(b =>
{
b.CollectionName = options.CollectionPrefix + "BlobContainers";
b.CollectionName = BlobStoringDatabaseDbProperties.DbTablePrefix + "BlobContainers";
});

builder.Entity<DatabaseBlob>(b =>
{
b.CollectionName = options.CollectionPrefix + "Blobs";
b.CollectionName = BlobStoringDatabaseDbProperties.DbTablePrefix + "Blobs";
});
}
}
}
}

This file was deleted.