Skip to content

Commit 037c156

Browse files
committed
Use ConfigureByConvention by the modules
1 parent 1eb034b commit 037c156

File tree

3 files changed

+13
-10
lines changed

3 files changed

+13
-10
lines changed

modules/audit-logging/src/Volo.Abp.AuditLogging.EntityFrameworkCore/Volo/Abp/AuditLogging/EntityFrameworkCore/AbpAuditLoggingDbContextModelBuilderExtensions.cs

+5-3
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ public static void ConfigureAuditLogging(
2525
{
2626
b.ToTable(options.TablePrefix + "AuditLogs", options.Schema);
2727

28-
b.ConfigureExtraProperties();
28+
b.ConfigureByConvention();
2929

3030
b.Property(x => x.ApplicationName).HasMaxLength(AuditLogConsts.MaxApplicationNameLength).HasColumnName(nameof(AuditLog.ApplicationName));
3131
b.Property(x => x.ClientIpAddress).HasMaxLength(AuditLogConsts.MaxClientIpAddressLength).HasColumnName(nameof(AuditLog.ClientIpAddress));
@@ -56,7 +56,7 @@ public static void ConfigureAuditLogging(
5656
{
5757
b.ToTable(options.TablePrefix + "AuditLogActions", options.Schema);
5858

59-
b.ConfigureExtraProperties();
59+
b.ConfigureByConvention();
6060

6161
b.Property(x => x.AuditLogId).HasColumnName(nameof(AuditLogAction.AuditLogId));
6262
b.Property(x => x.ServiceName).HasMaxLength(AuditLogActionConsts.MaxServiceNameLength).HasColumnName(nameof(AuditLogAction.ServiceName));
@@ -73,7 +73,7 @@ public static void ConfigureAuditLogging(
7373
{
7474
b.ToTable(options.TablePrefix + "EntityChanges", options.Schema);
7575

76-
b.ConfigureExtraProperties();
76+
b.ConfigureByConvention();
7777

7878
b.Property(x => x.EntityTypeFullName).HasMaxLength(EntityChangeConsts.MaxEntityTypeFullNameLength).IsRequired().HasColumnName(nameof(EntityChange.EntityTypeFullName));
7979
b.Property(x => x.EntityId).HasMaxLength(EntityChangeConsts.MaxEntityIdLength).IsRequired().HasColumnName(nameof(EntityChange.EntityId));
@@ -92,6 +92,8 @@ public static void ConfigureAuditLogging(
9292
{
9393
b.ToTable(options.TablePrefix + "EntityPropertyChanges", options.Schema);
9494

95+
b.ConfigureByConvention();
96+
9597
b.Property(x => x.NewValue).HasMaxLength(EntityPropertyChangeConsts.MaxNewValueLength).HasColumnName(nameof(EntityPropertyChange.NewValue));
9698
b.Property(x => x.PropertyName).HasMaxLength(EntityPropertyChangeConsts.MaxPropertyNameLength).IsRequired().HasColumnName(nameof(EntityPropertyChange.PropertyName));
9799
b.Property(x => x.PropertyTypeFullName).HasMaxLength(EntityPropertyChangeConsts.MaxPropertyTypeFullNameLength).IsRequired().HasColumnName(nameof(EntityPropertyChange.PropertyTypeFullName));

modules/background-jobs/src/Volo.Abp.BackgroundJobs.EntityFrameworkCore/Volo/Abp/BackgroundJobs/EntityFrameworkCore/BackgroundJobsDbContextModelCreatingExtensions.cs

+1-2
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,7 @@ public static void ConfigureBackgroundJobs(
2323
{
2424
b.ToTable(options.TablePrefix + "BackgroundJobs", options.Schema);
2525

26-
b.ConfigureCreationTime();
27-
b.ConfigureExtraProperties();
26+
b.ConfigureByConvention();
2827

2928
b.Property(x => x.JobName).IsRequired().HasMaxLength(BackgroundJobRecordConsts.MaxJobNameLength);
3029
b.Property(x => x.JobArgs).IsRequired().HasMaxLength(BackgroundJobRecordConsts.MaxJobArgsLength);

modules/blogging/src/Volo.Blogging.EntityFrameworkCore/Volo/Blogging/EntityFrameworkCore/BloggingDbContextModelBuilderExtensions.cs

+7-5
Original file line numberDiff line numberDiff line change
@@ -31,15 +31,15 @@ public static void ConfigureBlogging(
3131
{
3232
b.ToTable(options.TablePrefix + "Users", options.Schema);
3333

34+
b.ConfigureByConvention();
3435
b.ConfigureAbpUser();
35-
b.ConfigureExtraProperties();
3636
});
3737

3838
builder.Entity<Blog>(b =>
3939
{
4040
b.ToTable(options.TablePrefix + "Blogs", options.Schema);
4141

42-
b.ConfigureFullAuditedAggregateRoot();
42+
b.ConfigureByConvention();
4343

4444
b.Property(x => x.Name).IsRequired().HasMaxLength(BlogConsts.MaxNameLength).HasColumnName(nameof(Blog.Name));
4545
b.Property(x => x.ShortName).IsRequired().HasMaxLength(BlogConsts.MaxShortNameLength).HasColumnName(nameof(Blog.ShortName));
@@ -50,7 +50,7 @@ public static void ConfigureBlogging(
5050
{
5151
b.ToTable(options.TablePrefix + "Posts", options.Schema);
5252

53-
b.ConfigureFullAuditedAggregateRoot();
53+
b.ConfigureByConvention();
5454

5555
b.Property(x => x.BlogId).HasColumnName(nameof(Post.BlogId));
5656
b.Property(x => x.Title).IsRequired().HasMaxLength(PostConsts.MaxTitleLength).HasColumnName(nameof(Post.Title));
@@ -67,7 +67,7 @@ public static void ConfigureBlogging(
6767
{
6868
b.ToTable(options.TablePrefix + "Comments", options.Schema);
6969

70-
b.ConfigureFullAuditedAggregateRoot();
70+
b.ConfigureByConvention();
7171

7272
b.Property(x => x.Text).IsRequired().HasMaxLength(CommentConsts.MaxTextLength).HasColumnName(nameof(Comment.Text));
7373
b.Property(x => x.RepliedCommentId).HasColumnName(nameof(Comment.RepliedCommentId));
@@ -81,7 +81,7 @@ public static void ConfigureBlogging(
8181
{
8282
b.ToTable(options.TablePrefix + "Tags", options.Schema);
8383

84-
b.ConfigureFullAuditedAggregateRoot();
84+
b.ConfigureByConvention();
8585

8686
b.Property(x => x.Name).IsRequired().HasMaxLength(TagConsts.MaxNameLength).HasColumnName(nameof(Tag.Name));
8787
b.Property(x => x.Description).HasMaxLength(TagConsts.MaxDescriptionLength).HasColumnName(nameof(Tag.Description));
@@ -94,6 +94,8 @@ public static void ConfigureBlogging(
9494
{
9595
b.ToTable(options.TablePrefix + "PostTags", options.Schema);
9696

97+
b.ConfigureByConvention();
98+
9799
b.Property(x => x.PostId).HasColumnName(nameof(PostTag.PostId));
98100
b.Property(x => x.TagId).HasColumnName(nameof(PostTag.TagId));
99101

0 commit comments

Comments
 (0)