Browse Source

CmsKit - Handle SofDelete manually as temporary solution

pull/6926/head
enisn 5 years ago
parent
commit
74070ecc76
  1. 2
      modules/cms-kit/src/Volo.CmsKit.EntityFrameworkCore/Volo/CmsKit/EntityFrameworkCore/CmsKitDbContextModelCreatingExtensions.cs
  2. 11
      modules/cms-kit/test/Volo.CmsKit.TestBase/CmsKitDataSeedContributor.cs

2
modules/cms-kit/src/Volo.CmsKit.EntityFrameworkCore/Volo/CmsKit/EntityFrameworkCore/CmsKitDbContextModelCreatingExtensions.cs

@ -105,6 +105,8 @@ namespace Volo.CmsKit.EntityFrameworkCore
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);

11
modules/cms-kit/test/Volo.CmsKit.TestBase/CmsKitDataSeedContributor.cs

@ -215,9 +215,20 @@ namespace Volo.CmsKit
_cmsKitTestData.Content_2_EntityId,
_cmsKitTestData.Content_2
);
var content3 = new Content(
Guid.NewGuid(),
"a",
"b",
"Content"
)
{
IsDeleted = true,
};
await _contentRepository.InsertAsync(content1);
await _contentRepository.InsertAsync(content2);
await _contentRepository.InsertAsync(content3);
}
private async Task SeedTagsAsync()

Loading…
Cancel
Save