12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485 |
- using Ant.Entity;
- using Ant.Frame;
- using Newtonsoft.Json;
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- namespace Ant.ORM
- {
- public abstract class BaseEntityObj
- {
- /// <summary>
- /// 时间戳
- /// </summary>
- internal long TimeStamp
- {
- get;
- }
- //private readonly Dictionary<string, EntityValue> _Values = new Dictionary<string, EntityValue>();
- ///// <summary>
- ///// 改变状态值属性
- ///// </summary>
- //[JsonIgnore, NotMapped]
- //public Dictionary<string, EntityValue> Values
- //{
- // get; set;
- //}
- private EntityPersistType persistType;
- /// <summary>
- /// 操作类型
- /// </summary>
- [JsonIgnore, NotMapped]
- public EntityPersistType PersistType
- {
- get { return persistType; }
- set { persistType = value; }
- }
- ///// <summary>
- ///// 给实体赋值
- ///// </summary>
- ///// <param name="FieldName">字段名称</param>
- ///// <param name="defaultValue">默认值</param>
- //protected void SetChanaged(string FieldName, object defaultValue)
- //{
- // if (Values.IsNull())
- // Values = new Dictionary<string, EntityValue>();
- // if (_Values.ContainsKey(FieldName))
- // {
- // EntityValue val = _Values[FieldName];
- // if (object.Equals(val.OriginalValue, defaultValue))
- // {
- // val.CurrentValue = null;
- // val.IsChanage = false;
- // }
- // else
- // {
- // val.CurrentValue = defaultValue;
- // val.IsChanage = true;
- // Values.Add(FieldName, val);
- // }
- // }
- // else
- // {
- // EntityValue val = new EntityValue();
- // val.OriginalValue = defaultValue;
- // val.FieldName = FieldName;
- // val.IsChanage = false;
- // _Values.Add(FieldName, val);
- // }
- //}
- }
- }
|