public IEnumerable <URLModel> GetURLs(string sessionUserId, string cookieValues) { IEnumerable <URLModel> urlsToReturn = null; List <int> urlsFound = new List <int>(); string idForUrlsToFind = ""; if (string.IsNullOrEmpty(sessionUserId)) { idForUrlsToFind = cookieValues; if (!string.IsNullOrEmpty(idForUrlsToFind)) { urlsFound = StringToList(idForUrlsToFind); } urlsToReturn = UrlRepository.GetWhere(e => urlsFound.Contains(e.Id)); } else { var tempID = Convert.ToInt32(sessionUserId); var tempUser = UserRepository.GetWhere(x => x.Id == tempID).LastOrDefault(); urlsToReturn = tempUser.URLs; } return(urlsToReturn); }