Browse Source

Fix syntax error at CmsKitDbContextModelCreatingExtensions

pull/7024/head
enisn 6 years ago
parent
commit
0f78630889
  1. 25
      modules/cms-kit/src/Volo.CmsKit.EntityFrameworkCore/Volo/CmsKit/EntityFrameworkCore/CmsKitDbContextModelCreatingExtensions.cs

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

@ -99,16 +99,19 @@ namespace Volo.CmsKit.EntityFrameworkCore
if (GlobalFeatureManager.Instance.IsEnabled<ContentsFeature>()) if (GlobalFeatureManager.Instance.IsEnabled<ContentsFeature>())
{ {
b.ToTable(options.TablePrefix + "Contents", options.Schema); builder.Entity<Content>(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.EntityType).IsRequired().HasMaxLength(ContentConsts.MaxEntityTypeLength);
b.Property(x => x.EntityId).IsRequired().HasMaxLength(ContentConsts.MaxEntityIdLength); b.Property(x => x.EntityId).IsRequired().HasMaxLength(ContentConsts.MaxEntityIdLength);
b.Property(x => x.Value).IsRequired().HasMaxLength(ContentConsts.MaxValueLength); 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<TagsFeature>()) if (GlobalFeatureManager.Instance.IsEnabled<TagsFeature>())
{ {
@ -121,7 +124,11 @@ namespace Volo.CmsKit.EntityFrameworkCore
b.Property(x => x.EntityType).IsRequired().HasMaxLength(TagConsts.MaxEntityTypeLength); b.Property(x => x.EntityType).IsRequired().HasMaxLength(TagConsts.MaxEntityTypeLength);
b.Property(x => x.Name).IsRequired().HasMaxLength(TagConsts.MaxNameLength); 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<EntityTag>(b => builder.Entity<EntityTag>(b =>
@ -151,7 +158,7 @@ namespace Volo.CmsKit.EntityFrameworkCore
b.Property(x => x.Url).IsRequired().HasMaxLength(PageConsts.MaxUrlLength); b.Property(x => x.Url).IsRequired().HasMaxLength(PageConsts.MaxUrlLength);
b.Property(x => x.Description).HasMaxLength(PageConsts.MaxDescriptionLength); b.Property(x => x.Description).HasMaxLength(PageConsts.MaxDescriptionLength);
b.HasIndex(x => new {x.TenantId, x.Url}); b.HasIndex(x => new { x.TenantId, x.Url });
}); });
} }
} }

Loading…
Cancel
Save