using CMS.Plugin.PipeLineLems.Domain.Shared.MyTestEntityNames;
using Volo.Abp;
using Volo.Abp.Domain.Entities.Auditing;
namespace CMS.Plugin.PipeLineLems.Domain.MyTestEntityNames
{
///
/// MyTestEntityName
///
public class MyTestEntityName : FullAuditedAggregateRoot
{
///
/// Initializes a new instance of the class.
///
protected MyTestEntityName()
{
}
///
/// Initializes a new instance of the class.
///
/// The identifier.
/// The code.
/// The name.
/// The sort.
/// The remark.
public MyTestEntityName(Guid id, string code, string name, int sort = 0, string remark = null) : base(id)
{
Code = Check.NotNullOrWhiteSpace(code, "编号", MyTestEntityNameConsts.MaxCodeLength);
Name = Check.NotNullOrWhiteSpace(name, "名称", MyTestEntityNameConsts.MaxNameLength);
Sort = sort;
Remark = Check.Length(remark, "备注", MyTestEntityNameConsts.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, "编号", MyTestEntityNameConsts.MaxCodeLength);
Name = Check.NotNullOrWhiteSpace(name, "名称", MyTestEntityNameConsts.MaxNameLength);
Remark = Check.Length(remark, "备注", MyTestEntityNameConsts.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 MyTestEntityName Clone(Guid create, string name, int i)
{
return new MyTestEntityName(create, Code, name, i, Remark);
}
}
}