using CMS.Plugin.WareCmsUtilityApi.Domain.Shared.Samples; using Volo.Abp; using Volo.Abp.Domain.Entities.Auditing; namespace CMS.Plugin.WareCmsUtilityApi.Domain.Samples { /// /// Sample /// public class Sample : FullAuditedAggregateRoot { /// /// Initializes a new instance of the class. /// protected Sample() { } /// /// Initializes a new instance of the class. /// /// The identifier. /// The code. /// The name. /// The sort. /// The remark. public Sample(Guid id, string code, string name, int sort = 0, string remark = null) : base(id) { Code = Check.NotNullOrWhiteSpace(code, "编号", SampleConsts.MaxCodeLength); Name = Check.NotNullOrWhiteSpace(name, "名称", SampleConsts.MaxNameLength); Sort = sort; Remark = Check.Length(remark, "备注", SampleConsts.MaxRemarkLength); } /// /// 编号 /// public virtual string Code { get; protected set; } /// /// 名称 /// public virtual string Name { get; protected set; } /// /// 排序 /// public virtual int Sort { get; protected set; } /// /// 备注 /// public virtual string Remark { get; protected set; } /// /// 是否禁用 /// public virtual bool? IsDisabled { get; protected set; } /// /// Updates the specified code. /// /// The code. /// The name. /// The remark. public virtual void Update(string code, string name, string remark = null, bool? isDisabled = null) { Code = Check.NotNullOrWhiteSpace(code, "编号", SampleConsts.MaxCodeLength); Name = Check.NotNullOrWhiteSpace(name, "名称", SampleConsts.MaxNameLength); Remark = Check.Length(remark, "备注", SampleConsts.MaxRemarkLength); IsDisabled = isDisabled ?? IsDisabled; } /// /// Adjusts the sort. /// /// The sort. public void AdjustSort(int sort) { Sort = sort; } /// /// Clones the specified create. /// /// The create. /// The name. /// The i. /// public Sample Clone(Guid create, string name, int i) { return new Sample(create, Code, name, i, Remark); } } }