diff --git a/modules/cms-kit/host/Volo.CmsKit.Web.Unified/Migrations/20221118063752_Initial.Designer.cs b/modules/cms-kit/host/Volo.CmsKit.Web.Unified/Migrations/20221216140823_Initial.Designer.cs similarity index 99% rename from modules/cms-kit/host/Volo.CmsKit.Web.Unified/Migrations/20221118063752_Initial.Designer.cs rename to modules/cms-kit/host/Volo.CmsKit.Web.Unified/Migrations/20221216140823_Initial.Designer.cs index be27b87df8..62e4c309ca 100644 --- a/modules/cms-kit/host/Volo.CmsKit.Web.Unified/Migrations/20221118063752_Initial.Designer.cs +++ b/modules/cms-kit/host/Volo.CmsKit.Web.Unified/Migrations/20221216140823_Initial.Designer.cs @@ -13,7 +13,7 @@ using Volo.CmsKit.EntityFrameworkCore; namespace Volo.CmsKit.Migrations { [DbContext(typeof(UnifiedDbContext))] - [Migration("20221118063752_Initial")] + [Migration("20221216140823_Initial")] partial class Initial { /// @@ -1488,6 +1488,9 @@ namespace Volo.CmsKit.Migrations .HasColumnType("datetime2") .HasColumnName("DeletionTime"); + b.Property("EntityVersion") + .HasColumnType("int"); + b.Property("ExtraProperties") .HasColumnType("nvarchar(max)") .HasColumnName("ExtraProperties"); @@ -1823,6 +1826,9 @@ namespace Volo.CmsKit.Migrations .HasColumnType("datetime2") .HasColumnName("DeletionTime"); + b.Property("EntityVersion") + .HasColumnType("int"); + b.Property("ExtraProperties") .HasColumnType("nvarchar(max)") .HasColumnName("ExtraProperties"); diff --git a/modules/cms-kit/host/Volo.CmsKit.Web.Unified/Migrations/20221118063752_Initial.cs b/modules/cms-kit/host/Volo.CmsKit.Web.Unified/Migrations/20221216140823_Initial.cs similarity index 99% rename from modules/cms-kit/host/Volo.CmsKit.Web.Unified/Migrations/20221118063752_Initial.cs rename to modules/cms-kit/host/Volo.CmsKit.Web.Unified/Migrations/20221216140823_Initial.cs index 5104516364..93182aafe3 100644 --- a/modules/cms-kit/host/Volo.CmsKit.Web.Unified/Migrations/20221118063752_Initial.cs +++ b/modules/cms-kit/host/Volo.CmsKit.Web.Unified/Migrations/20221216140823_Initial.cs @@ -506,6 +506,7 @@ namespace Volo.CmsKit.Migrations Script = table.Column(type: "nvarchar(max)", nullable: true), Style = table.Column(type: "nvarchar(max)", nullable: true), IsHomePage = table.Column(type: "bit", nullable: false), + EntityVersion = table.Column(type: "int", nullable: false), ExtraProperties = table.Column(type: "nvarchar(max)", nullable: true), ConcurrencyStamp = table.Column(type: "nvarchar(40)", maxLength: 40, nullable: true), CreationTime = table.Column(type: "datetime2", nullable: false), @@ -869,6 +870,7 @@ namespace Volo.CmsKit.Migrations TenantId = table.Column(type: "uniqueidentifier", nullable: true), AuthorId = table.Column(type: "uniqueidentifier", nullable: false), Status = table.Column(type: "int", nullable: false), + EntityVersion = table.Column(type: "int", nullable: false), ExtraProperties = table.Column(type: "nvarchar(max)", nullable: true), ConcurrencyStamp = table.Column(type: "nvarchar(40)", maxLength: 40, nullable: true), CreationTime = table.Column(type: "datetime2", nullable: false), diff --git a/modules/cms-kit/host/Volo.CmsKit.Web.Unified/Migrations/UnifiedDbContextModelSnapshot.cs b/modules/cms-kit/host/Volo.CmsKit.Web.Unified/Migrations/UnifiedDbContextModelSnapshot.cs index 82bfddb31c..4e851eed3a 100644 --- a/modules/cms-kit/host/Volo.CmsKit.Web.Unified/Migrations/UnifiedDbContextModelSnapshot.cs +++ b/modules/cms-kit/host/Volo.CmsKit.Web.Unified/Migrations/UnifiedDbContextModelSnapshot.cs @@ -1485,6 +1485,9 @@ namespace Volo.CmsKit.Migrations .HasColumnType("datetime2") .HasColumnName("DeletionTime"); + b.Property("EntityVersion") + .HasColumnType("int"); + b.Property("ExtraProperties") .HasColumnType("nvarchar(max)") .HasColumnName("ExtraProperties"); @@ -1820,6 +1823,9 @@ namespace Volo.CmsKit.Migrations .HasColumnType("datetime2") .HasColumnName("DeletionTime"); + b.Property("EntityVersion") + .HasColumnType("int"); + b.Property("ExtraProperties") .HasColumnType("nvarchar(max)") .HasColumnName("ExtraProperties"); diff --git a/modules/cms-kit/src/Volo.CmsKit.Admin.Application.Contracts/Volo/CmsKit/Admin/Blogs/BlogPostDto.cs b/modules/cms-kit/src/Volo.CmsKit.Admin.Application.Contracts/Volo/CmsKit/Admin/Blogs/BlogPostDto.cs index 3e109a9eed..244ef8e8e5 100644 --- a/modules/cms-kit/src/Volo.CmsKit.Admin.Application.Contracts/Volo/CmsKit/Admin/Blogs/BlogPostDto.cs +++ b/modules/cms-kit/src/Volo.CmsKit.Admin.Application.Contracts/Volo/CmsKit/Admin/Blogs/BlogPostDto.cs @@ -7,7 +7,7 @@ using Volo.CmsKit.Blogs; namespace Volo.CmsKit.Admin.Blogs; [Serializable] -public class BlogPostDto : EntityDto, IHasCreationTime, IHasModificationTime, IHasConcurrencyStamp +public class BlogPostDto : EntityDto, IHasCreationTime, IHasModificationTime, IHasConcurrencyStamp, IHasEntityVersion { public Guid BlogId { get; set; } @@ -26,6 +26,8 @@ public class BlogPostDto : EntityDto, IHasCreationTime, IHasModificationTi public DateTime? LastModificationTime { get; set; } public string ConcurrencyStamp { get; set; } - + public BlogPostStatus Status { get; set; } + + public int EntityVersion { get; set; } } diff --git a/modules/cms-kit/src/Volo.CmsKit.Admin.Application.Contracts/Volo/CmsKit/Admin/Pages/PageDto.cs b/modules/cms-kit/src/Volo.CmsKit.Admin.Application.Contracts/Volo/CmsKit/Admin/Pages/PageDto.cs index f8348302d2..0063616f37 100644 --- a/modules/cms-kit/src/Volo.CmsKit.Admin.Application.Contracts/Volo/CmsKit/Admin/Pages/PageDto.cs +++ b/modules/cms-kit/src/Volo.CmsKit.Admin.Application.Contracts/Volo/CmsKit/Admin/Pages/PageDto.cs @@ -1,11 +1,12 @@ using System; using Volo.Abp.Application.Dtos; +using Volo.Abp.Auditing; using Volo.Abp.Domain.Entities; namespace Volo.CmsKit.Admin.Pages; [Serializable] -public class PageDto : AuditedEntityDto, IHasConcurrencyStamp +public class PageDto : AuditedEntityDto, IHasConcurrencyStamp, IHasEntityVersion { public string Title { get; set; } @@ -18,6 +19,8 @@ public class PageDto : AuditedEntityDto, IHasConcurrencyStamp public string Style { get; set; } public bool IsHomePage { get; set; } - + public string ConcurrencyStamp { get; set; } + + public int EntityVersion { get; set; } } diff --git a/modules/cms-kit/src/Volo.CmsKit.Common.Application.Contracts/Volo/CmsKit/Contents/PageDto.cs b/modules/cms-kit/src/Volo.CmsKit.Common.Application.Contracts/Volo/CmsKit/Contents/PageDto.cs index d495c5de20..6357870f40 100644 --- a/modules/cms-kit/src/Volo.CmsKit.Common.Application.Contracts/Volo/CmsKit/Contents/PageDto.cs +++ b/modules/cms-kit/src/Volo.CmsKit.Common.Application.Contracts/Volo/CmsKit/Contents/PageDto.cs @@ -1,11 +1,11 @@ -using System.Collections.Generic; -using System; +using System; using Volo.Abp.Application.Dtos; +using Volo.Abp.Auditing; namespace Volo.CmsKit.Contents; [Serializable] -public class PageDto : EntityDto +public class PageDto : EntityDto, IHasEntityVersion { public string Title { get; set; } @@ -16,4 +16,6 @@ public class PageDto : EntityDto public string Script { get; set; } public string Style { get; set; } + + public int EntityVersion { get; set; } } \ No newline at end of file diff --git a/modules/cms-kit/src/Volo.CmsKit.Domain/Volo/CmsKit/Blogs/BlogPost.cs b/modules/cms-kit/src/Volo.CmsKit.Domain/Volo/CmsKit/Blogs/BlogPost.cs index cca45bf4fe..3a4cf26c1b 100644 --- a/modules/cms-kit/src/Volo.CmsKit.Domain/Volo/CmsKit/Blogs/BlogPost.cs +++ b/modules/cms-kit/src/Volo.CmsKit.Domain/Volo/CmsKit/Blogs/BlogPost.cs @@ -1,13 +1,14 @@ -using JetBrains.Annotations; -using System; +using System; +using JetBrains.Annotations; using Volo.Abp; +using Volo.Abp.Auditing; using Volo.Abp.Domain.Entities.Auditing; using Volo.Abp.MultiTenancy; using Volo.CmsKit.Users; namespace Volo.CmsKit.Blogs; -public class BlogPost : FullAuditedAggregateRoot, IMultiTenant +public class BlogPost : FullAuditedAggregateRoot, IMultiTenant, IHasEntityVersion { public virtual Guid BlogId { get; protected set; } @@ -29,9 +30,11 @@ public class BlogPost : FullAuditedAggregateRoot, IMultiTenant public Guid AuthorId { get; set; } public virtual CmsUser Author { get; set; } - + public virtual BlogPostStatus Status { get; set; } - + + public virtual int EntityVersion { get; protected set; } + protected BlogPost() { } @@ -81,12 +84,12 @@ public class BlogPost : FullAuditedAggregateRoot, IMultiTenant { Content = Check.Length(content, nameof(content), BlogPostConsts.MaxContentLength); } - + public virtual void SetDraft() { Status = BlogPostStatus.Draft; } - + public virtual void SetPublished() { Status = BlogPostStatus.Published; 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 449b07091b..1ed89ff7f6 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 @@ -1,12 +1,13 @@ using System; using JetBrains.Annotations; using Volo.Abp; +using Volo.Abp.Auditing; using Volo.Abp.Domain.Entities.Auditing; using Volo.Abp.MultiTenancy; namespace Volo.CmsKit.Pages; -public class Page : FullAuditedAggregateRoot, IMultiTenant +public class Page : FullAuditedAggregateRoot, IMultiTenant, IHasEntityVersion { public virtual Guid? TenantId { get; protected set; } @@ -22,6 +23,8 @@ public class Page : FullAuditedAggregateRoot, IMultiTenant public virtual bool IsHomePage { get; protected set; } + public virtual int EntityVersion { get; protected set; } + protected Page() { } @@ -69,8 +72,8 @@ public class Page : FullAuditedAggregateRoot, IMultiTenant Style = Check.Length(style, nameof(style), PageConsts.MaxStyleLength); } - internal void SetIsHomePage(bool isHomePage) + internal void SetIsHomePage(bool isHomePage) { IsHomePage = isHomePage; - } + } }