Example #1
0
        public List <ApiKey> GetUserApiKeys(string userId)
        {
            List <JarsApiKey> keys = ApiKeyRepository.Where(k => k.UserAuthId == userId &&
                                                            k.CancelledDate == null &&
                                                            (k.ExpiryDate == null || k.ExpiryDate >= DateTime.UtcNow))
                                     .OrderByDescending(k => k.CreatedDate).ToList();

            return(keys.ConvertAll(k => k.ConvertTo <ApiKey>()));
        }