using System; using System.Collections.Generic; using System.Text; namespace Apewer.Source { /// public static class Extensions { /// 设置 Updated 属性。 /// TRUE:设置成功;FALSE:设置失败。 public static bool SetUpdated(this IRecord record) { if (record == null) return false; var moment = record as IRecordMoment; if (moment != null) { var now = ClockUtility.LucidNow; moment.Updated = now; return true; } var stamp = record as IRecordStamp; if (stamp != null) { var utc = ClockUtility.UtcStamp; stamp.Updated = utc; return true; } return false; } } }