public async Task RemoveBySubject(string subject) { if (subject == null) { throw new ArgumentNullException(nameof(subject)); } using (var c = await RedisManager.GetConnection()) { var skKey = SubjectRefreshTokensRedisKey.Create(subject); var sk = new RedisKey <SubjectRefreshTokenList>(skKey, c); var subjectRefreshTokenList = await sk.GetAsync(); if (subjectRefreshTokenList != null) { var keysToRemove = subjectRefreshTokenList .Select(itm => RefreshTokenRedisKey.Create(itm.RefreshToken)); await c.DeleteKeysAsync(keysToRemove); } await sk.DeleteAsync(); } }