diff --git a/modules/cms-kit/src/Volo.CmsKit.Domain/Volo/CmsKit/Contents/Content.cs b/modules/cms-kit/src/Volo.CmsKit.Domain/Volo/CmsKit/Contents/Content.cs index 434ae4847b..392abfbc6f 100644 --- a/modules/cms-kit/src/Volo.CmsKit.Domain/Volo/CmsKit/Contents/Content.cs +++ b/modules/cms-kit/src/Volo.CmsKit.Domain/Volo/CmsKit/Contents/Content.cs @@ -8,41 +8,37 @@ namespace Volo.CmsKit.Contents { public class Content : FullAuditedAggregateRoot, IMultiTenant { - [CanBeNull] - public virtual Guid? TenantId { get; protected set; } - - [NotNull] - public virtual string EntityType { get; protected set; } - - [NotNull] - public virtual string EntityId { get; protected set; } - - [NotNull] - public virtual string Value { get; protected set; } + [CanBeNull] public virtual Guid? TenantId { get; protected set; } + + [NotNull] public virtual string EntityType { get; protected set; } + + [NotNull] public virtual string EntityId { get; protected set; } + + [NotNull] public virtual string Value { get; protected set; } protected Content() { - } - - public Content(Guid id, [NotNull] string entityType, [NotNull] string entityId, [NotNull] string value, Guid? tenantId = null) : base(id) + + public Content(Guid id, [NotNull] string entityType, [NotNull] string entityId, [NotNull] string value, + Guid? tenantId = null) : base(id) { EntityId = Check.NotNullOrWhiteSpace(entityId, nameof(entityId), ContentConsts.MaxEntityIdLength); EntityType = Check.NotNullOrEmpty(entityType, nameof(entityType), ContentConsts.MaxEntityTypeLength); Value = Check.NotNullOrEmpty(value, nameof(value), ContentConsts.MaxValueLength); - + TenantId = tenantId; } - public void SetValue([NotNull] string value) + public virtual void SetValue([NotNull] string value) { Value = Check.NotNullOrEmpty(value, nameof(value), ContentConsts.MaxValueLength); } - public void SetEntity([NotNull] string entityType, [NotNull] string entityId) + public virtual void SetEntity([NotNull] string entityType, [NotNull] string entityId) { EntityType = Check.NotNullOrEmpty(entityType, nameof(entityType), ContentConsts.MaxEntityTypeLength); EntityId = Check.NotNullOrWhiteSpace(entityId, nameof(entityId), ContentConsts.MaxEntityIdLength); } } -} +} \ No newline at end of file diff --git a/modules/cms-kit/src/Volo.CmsKit.Domain/Volo/CmsKit/Pages/Page.cs b/modules/cms-kit/src/Volo.CmsKit.Domain/Volo/CmsKit/Pages/Page.cs index f56dcd10bc..cae13a5254 100644 --- a/modules/cms-kit/src/Volo.CmsKit.Domain/Volo/CmsKit/Pages/Page.cs +++ b/modules/cms-kit/src/Volo.CmsKit.Domain/Volo/CmsKit/Pages/Page.cs @@ -8,7 +8,7 @@ namespace Volo.CmsKit.Pages { public class Page : FullAuditedAggregateRoot, IMultiTenant { - [CanBeNull] public virtual Guid? TenantId { get; set; } + [CanBeNull] public virtual Guid? TenantId { get; protected set; } [NotNull] public virtual string Title { get; protected set; } diff --git a/modules/cms-kit/src/Volo.CmsKit.Domain/Volo/CmsKit/Tags/Tag.cs b/modules/cms-kit/src/Volo.CmsKit.Domain/Volo/CmsKit/Tags/Tag.cs index 0c6ad99b2a..4b0ba20e30 100644 --- a/modules/cms-kit/src/Volo.CmsKit.Domain/Volo/CmsKit/Tags/Tag.cs +++ b/modules/cms-kit/src/Volo.CmsKit.Domain/Volo/CmsKit/Tags/Tag.cs @@ -8,7 +8,7 @@ namespace Volo.CmsKit.Tags { public class Tag : FullAuditedAggregateRoot, IMultiTenant { - public virtual Guid? TenantId { get; set; } + public virtual Guid? TenantId { get; protected set; } [NotNull] public virtual string EntityType { get; protected set; } @@ -33,7 +33,7 @@ namespace Volo.CmsKit.Tags public virtual void SetName(string name) { - Name = Check.NotNullOrWhiteSpace(name, nameof(name), TagConsts.MaxNameLength); + Name = Check.NotNullOrEmpty(name, nameof(name), TagConsts.MaxNameLength); } public virtual void SetEntityType(string entityType)