Beispiel #1
0
    public byte[] GetData()
    {
        SessionSerializer serializer = new SessionSerializer();

        serializer.Serialize(m_packet);

        return(serializer.GetSerializedData());
    }
        private void GetCurrentRecords(Action <IList <NotifyRecord> > action)
        {
            if (this.session == null)
            {
                return;
            }

            lock (this.session.Id)
            {
                var collection =
                    SessionSerializer.Deserialize <List <NotifyRecord> >(
                        this.session.GetString(NotificationMessagesSessionKey)) ??
                    new List <NotifyRecord>();

                action(collection);
                this.session.SetString(NotificationMessagesSessionKey, SessionSerializer.Serialize(collection));
            }
        }
Beispiel #3
0
        protected override byte[] SerializeSession(object sessionData)
        {
            NCacheSessionData session = sessionData as NCacheSessionData;

            return(SessionSerializer.Serialize(session));
        }