Example #1
0
        public static void SetObjectAsByteArray(this ISession session, string key, object value)
        {
            Type type = value.GetType();

            session.Set(key, PackUtility.Pack(type, value));
        }
        public static void SetObjectAsByteArray(this IDistributedCache cache, string key, object value, DistributedCacheEntryOptions option = default(DistributedCacheEntryOptions))
        {
            Type type = value.GetType();

            cache.Set(key, PackUtility.Pack(type, value), option);
        }
Example #3
0
 public static void SetObjectAsByteArray <T>(this ISession session, string key, T value)
 {
     session.Set(key, PackUtility.Pack <T>(value));
 }
 public static void SetObjectAsByteArray <T>(this IDistributedCache cache, string key, T value, DistributedCacheEntryOptions option = default(DistributedCacheEntryOptions))
 {
     cache.Set(key, PackUtility.Pack <T>(value), option);
 }