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 SessionRecord LoadSession(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(); SessionRecord sessionRecord = new SessionRecord(session.Record); return(sessionRecord); } return(new SessionRecord()); }
public List <uint> GetSubDeviceSessions(string recipientId) { List <uint> retVal = new List <uint>(); SessionsRepository sessionsRepository = new SessionsRepository(); List <Sessions> sessions = sessionsRepository.GetSessions(recipientId); if (sessions != null && sessions.Count > 0) { foreach (Sessions session in sessions) { retVal.Add(session.DeviceId); } } return(retVal.Count > 0 ? retVal : null); }
private IEnumerable <Session> GetSessions() { // Note: In a real project, your data repository could link to your proto and serialize/deserialize it // directly as a model object. In this demo project, we have both the ASP.NET Core WebAPI proto gen and the // shared CodeCamp.Grpc projects which both compile the proto, so rather than conflict them, we're just // returning the strings of the session data and letting each project convert to its own version of `Session`. foreach (var row in sessionsRepo.GetSessions()) { yield return(new Session { Room = row[0], TimeSlot = row[1], SpeakerName = row[2], Title = row[3], Abstract = row[4], Level = row[5] }); } }
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()); } }