Пример #1
0
        public void DeleteSession(AxolotlAddress address)
        {
            SessionsRepository sessionsRepository = new SessionsRepository();
            List <Sessions>    sessions           = sessionsRepository.GetSessions(address.GetName(), address.GetDeviceId());

            if (sessions != null && sessions.Count > 0)
            {
                Sessions session = sessions.First();
                sessionsRepository.Delete(session);
            }
        }
Пример #2
0
        public void DeleteAllSessions(string name)
        {
            SessionsRepository sessionsRepository = new SessionsRepository();
            List <Sessions>    sessions           = sessionsRepository.GetSessions(name);

            if (sessions != null && sessions.Count > 0)
            {
                foreach (Sessions session in sessions)
                {
                    sessionsRepository.Delete(session);
                }
            }
        }
Пример #3
0
        public void ClearRecipient(string recipientId)
        {
            IdentityKeysRepository identityKeysRepository = new IdentityKeysRepository();
            List <IdentityKeys>    identityKeys           = identityKeysRepository.GetIdentityKeys(recipientId);

            if (identityKeys != null && identityKeys.Count > 0)
            {
                identityKeysRepository.Delete(identityKeys.First());
            }

            SessionsRepository sessionsRepository = new SessionsRepository();
            List <Sessions>    sessions           = sessionsRepository.GetSessions(recipientId);

            if (sessions != null && sessions.Count > 0)
            {
                sessionsRepository.Delete(sessions.First());
            }
        }
Пример #4
0
 public IHttpActionResult DeleteSession(int id)
 {
     _sessionsRepository.Delete(id);
     return(Ok());
 }
Пример #5
0
 public Task <HttpResponseMessage> Delete(int id)
 {
     sessionRepository.Delete(id);
     return(Task.FromResult(Request.CreateResponse(HttpStatusCode.OK)));
 }