using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace PublicCode { /// /// 包含主键(id),创建时间(create_time) /// public class BaseModelLow :IBaseModelLow { /// /// 主键 /// public string Id { get; set; } /// /// 创建时间 /// public string Create_Time { get; set; } /// /// 基本状态,0为默认 /// public string State { get; set; } /// /// 删除状态,0为默认,-2为逻辑删除 /// public string Is_Delete { get; set; } /// /// 初始化赋值 /// public virtual void Init() { Id = Guid.NewGuid().ToString(); Create_Time = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff"); State = "0"; Is_Delete = "0"; } public virtual bool IsNull() { bool res = true; foreach (var a in this.GetType().GetProperties()) { res = res && string.IsNullOrWhiteSpace(Convert.ToString(a.GetValue(this))); } return res; } } }