Ejemplo n.º 1
0
 public void DeleteSession(tbSession theSession)
 {
     try
     {
         theSession.UpdateDateTime = DateTime.UtcNow;
         theSession.IsDeleted = true;
         _db.SaveChanges();
     }
     catch (DataException dex)
     {
         throw new ApplicationException("Data error!", dex);
     }
 }
Ejemplo n.º 2
0
 public void UpdateSession(tbSession theSession)
 {
     try
     {
         theSession.Expiry.AddDays(1);
         theSession.UpdateDateTime = DateTime.UtcNow;
         _db.SaveChanges();
     }
     catch (DataException dex)
     {
         throw new ApplicationException("Data error!", dex);
     }
 }
Ejemplo n.º 3
0
 public async Task DeleteSessionAsync(tbSession theSession)
 {
     try
     {
         theSession.UpdateDateTime = DateTime.UtcNow;
         theSession.IsDeleted = true;
         await _db.SaveChangesAsync();
     }
     catch (DataException dex)
     {
         throw new ApplicationException("Data error!", dex);
     }
 }
Ejemplo n.º 4
0
        public async Task CreateNewSession(UserProfileDetails userPro, string IPAddress)
        {
            try
            {
                tbSession ses = new tbSession();
                ses.Id = Guid.NewGuid();
                ses.CreateDateTime = DateTime.UtcNow;
                ses.Expiry = DateTime.UtcNow.AddDays(1);
                ses.ProfileId = userPro.ProfileId;
                ses.IPAddress = IPAddress;

                _db.tbSessions.Add(ses);
                await _db.SaveChangesAsync();
            }
            catch (DataException dex)
            {
                throw new ApplicationException("Data error!", dex);
            }
        }