public static EntityObjectBase Copy(EntityObjectBase objEntity) { //生成拷贝实例 Type type = objEntity.GetType(); EntityObjectBase objCopy = (EntityObjectBase)Activator.CreateInstance(type); //拷贝属性值 objCopy.FromTable(objEntity.ToTable()); //拷贝原始值 objCopy.table = objEntity.table.Copy(); return(objCopy); }
/// <summary> /// 设置原始值 /// </summary> /// <param name="objEntity">实体对像</param> public static void SetOriginalValue(EntityObjectBase objEntity) { objEntity.table = objEntity.ToTable(); }