public static DateTime?GetExpire <T>(this ISyncAdvancedSessionOperation advanced, T obj)
        {
            RavenJToken token;

            if (advanced.GetMetadataFor(obj).TryGetValue("Raven-Expiration-Date", out token))
            {
                var date = token.Value <DateTime>();
                return(date);
            }
            return(null);
        }
 public static void AddExpire <T>(this ISyncAdvancedSessionOperation advanced, T obj, DateTime dateTime)
 {
     advanced.GetMetadataFor(obj)["Raven-Expiration-Date"] = new RavenJValue(dateTime);
 }
 public static void RemoveExpire <T>(this ISyncAdvancedSessionOperation advanced, T obj)
 {
     advanced.GetMetadataFor(obj).Remove("Raven-Expiration-Date");
 }
 public static TemporalMetadata GetTemporalMetadataFor <T>(this ISyncAdvancedSessionOperation session, T instance)
 {
     return(session.GetMetadataFor(instance).GetTemporalMetadata());
 }