From 6079da52900e4dbe5abbbc614ed575a9fc4bfcba Mon Sep 17 00:00:00 2001 From: enisn Date: Mon, 4 Jan 2021 12:47:42 +0300 Subject: [PATCH] CmsKit - Temporary solution for Content deletion --- .../CmsKitDbContextModelCreatingExtensions.cs | 6 ++++-- 1 file changed, 4 insertions(+), 2 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 8d32de7958..ebcb5dc22e 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 @@ -100,9 +100,11 @@ namespace Volo.CmsKit.EntityFrameworkCore builder.Entity(b => { b.ToTable(options.TablePrefix + "Contents", options.Schema); - + b.ConfigureByConvention(); - + + b.HasQueryFilter(x => !x.IsDeleted); // TODO: Find out why default filter doesn't work. + 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);