Пример #1
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="senderKeyName"></param>
        /// <param name="record"></param>
        public void StoreSenderKey(SenderKeyName senderKeyName, SenderKeyRecord record)
        {
            if (SenderKeysObjectsDic.ContainsKey(senderKeyName))
            {
                SenderKeysObjectsDic.Remove(senderKeyName);
            }

            SenderKeysObjectsDic.Add(senderKeyName, new SenderKeysObject()
            {
                SenderKeyKeyName = senderKeyName,
                Record           = record.Serialize()
            });
        }
Пример #2
0
        public void StoreSenderKey(SenderKeyName senderKeyName, SenderKeyRecord record)
        {
            if (ContainsSenderKey(senderKeyName))
            {
                RemoveSenderKey(senderKeyName);
            }

            String senderKeyId = senderKeyName.GetSender().GetName() + " : " + senderKeyName.GetGroupId();
            SenderKeysRepository senderKeysRepository = new SenderKeysRepository();

            SenderKeys senderKey = new SenderKeys()
            {
                Record      = record.Serialize(),
                SenderKeyId = senderKeyId
            };

            senderKeysRepository.Save(senderKey);
        }