Beispiel #1
0
        public static Task ClearTimeOutAccessToken(APIDbContext _dbContext)
        {
            var _toDel = _dbContext.AccessToken
                         .ToList()
                         .Where(t => !t.IsAlive);

            _dbContext.AccessToken.RemoveRange(_toDel);
            return(_dbContext.SaveChangesAsync());
        }
Beispiel #2
0
        public static Task ClearTimeOutOAuthPack(APIDbContext _dbContext)
        {
            var _UsedAndNoToken = _dbContext.OAuthPack
                                  .Where(t => t.IsUsed == true);

            var _Timeout = _dbContext.OAuthPack
                           .ToList()
                           .Where(t => !t.IsAlive);

            _dbContext.OAuthPack.RemoveRange(_UsedAndNoToken);
            _dbContext.OAuthPack.RemoveRange(_Timeout);
            return(_dbContext.SaveChangesAsync());
        }
Beispiel #3
0
 public static async Task AllClean(APIDbContext _dbContext)
 {
     await ClearTimeOutAccessToken(_dbContext);
     await ClearTimeOutOAuthPack(_dbContext);
 }