You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

39 lines
913 B

using System;
using System.Collections.Generic;
using System.Text;
namespace Apewer.Source
{
/// <summary></summary>
public static class Extensions
{
/// <summary>设置 Updated 属性。</summary>
/// <returns>TRUE:设置成功;FALSE:设置失败。</returns>
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;
}
}
}