1. 程式人生 > >應用程式框架實戰三十四:資料傳輸物件(DTO)介紹及各型別實體比較

應用程式框架實戰三十四:資料傳輸物件(DTO)介紹及各型別實體比較

using System.ComponentModel.DataAnnotations; using Util; using Util.Domains.Repositories; namespace Biz.Security.Domains.Queries { /// <summary> /// 應用程式查詢實體 /// </summary> public class ApplicationQuery : Pager { /// <summary> /// 應用程式編號 /// </summary>
[Display( Name = "應用程式編號" )] public System.Guid? ApplicationId { get; set; } private string _code = string.Empty; /// <summary> /// 應用程式編碼 /// </summary> [Display( Name = "應用程式編碼" )] public string Code { get { return
_code == null ? string.Empty : _code.Trim(); } set { _code = value; } } private string _name = string.Empty; /// <summary> /// 應用程式名稱 /// </summary> [Display( Name = "應用程式名稱" )] public string Name { get { return
_name == null ? string.Empty : _name.Trim(); } set { _name = value; } } private string _note = string.Empty; /// <summary> /// 備註 /// </summary> [Display( Name = "備註" )] public string Note { get { return _note == null ? string.Empty : _note.Trim(); } set { _note = value; } } /// <summary> /// 啟用 /// </summary> [Display( Name = "啟用" )] public bool? Enabled { get; set; } /// <summary> /// 起始建立時間 /// </summary> [Display( Name = "起始建立時間" )] public System.DateTime? BeginCreateTime { get; set; } /// <summary> /// 結束建立時間 /// </summary> [Display( Name = "結束建立時間" )] public System.DateTime? EndCreateTime { get; set; } /// <summary> /// 新增描述 /// </summary> protected override void AddDescriptions() { base.AddDescriptions(); AddDescription( "應用程式編號", ApplicationId ); AddDescription( "應用程式編碼", Code ); AddDescription( "應用程式名稱", Name ); AddDescription( "備註", Note ); AddDescription( "啟用", Enabled.Description() ); AddDescription( "起始建立時間", BeginCreateTime ); AddDescription( "結束建立時間", EndCreateTime ); } } }