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);
            }
        }
        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);
                }
            }
        }
        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());
            }
        }
Beispiel #4
0
 public IHttpActionResult DeleteSession(int id)
 {
     _sessionsRepository.Delete(id);
     return(Ok());
 }
Beispiel #5
0
 public Task <HttpResponseMessage> Delete(int id)
 {
     sessionRepository.Delete(id);
     return(Task.FromResult(Request.CreateResponse(HttpStatusCode.OK)));
 }