From 0f786308893ebb8bccdd5e4875d508f6f7ca476c Mon Sep 17 00:00:00 2001 From: enisn Date: Thu, 7 Jan 2021 15:21:53 +0300 Subject: [PATCH] Fix syntax error at CmsKitDbContextModelCreatingExtensions --- .../CmsKitDbContextModelCreatingExtensions.cs | 25 ++++++++++++------- 1 file changed, 16 insertions(+), 9 deletions(-) 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 d089a8fe9d..8e3b7160db 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 @@ -99,16 +99,19 @@ namespace Volo.CmsKit.EntityFrameworkCore if (GlobalFeatureManager.Instance.IsEnabled()) { - b.ToTable(options.TablePrefix + "Contents", options.Schema); + builder.Entity(b => + { + b.ToTable(options.TablePrefix + "Contents", options.Schema); - b.ConfigureByConvention(); + b.ConfigureByConvention(); - b.Property(x => x.EntityType).IsRequired().HasMaxLength(ContentConsts.MaxEntityTypeLength); - b.Property(x => x.EntityId).IsRequired().HasMaxLength(ContentConsts.MaxEntityIdLength); - b.Property(x => x.Value).IsRequired().HasMaxLength(ContentConsts.MaxValueLength); + b.Property(x => x.EntityType).IsRequired().HasMaxLength(ContentConsts.MaxEntityTypeLength); + b.Property(x => x.EntityId).IsRequired().HasMaxLength(ContentConsts.MaxEntityIdLength); + b.Property(x => x.Value).IsRequired().HasMaxLength(ContentConsts.MaxValueLength); - b.HasIndex(x => new { x.TenantId, x.EntityType, x.EntityId }); - }); + b.HasIndex(x => new { x.TenantId, x.EntityType, x.EntityId }); + }); + } if (GlobalFeatureManager.Instance.IsEnabled()) { @@ -121,7 +124,11 @@ namespace Volo.CmsKit.EntityFrameworkCore b.Property(x => x.EntityType).IsRequired().HasMaxLength(TagConsts.MaxEntityTypeLength); b.Property(x => x.Name).IsRequired().HasMaxLength(TagConsts.MaxNameLength); - b.HasIndex(x => new { x.TenantId, x.Name }); + b.HasIndex(x => new + { + x.TenantId, + x.Name + }); }); builder.Entity(b => @@ -151,7 +158,7 @@ namespace Volo.CmsKit.EntityFrameworkCore b.Property(x => x.Url).IsRequired().HasMaxLength(PageConsts.MaxUrlLength); b.Property(x => x.Description).HasMaxLength(PageConsts.MaxDescriptionLength); - b.HasIndex(x => new {x.TenantId, x.Url}); + b.HasIndex(x => new { x.TenantId, x.Url }); }); } }