public IEnumerable <SaleToken> GetAllActive(string userId) { UserPreferences userPreferences = new UserPreferences(userId); if (!string.IsNullOrWhiteSpace(userId)) { userPreferences = _userPreferencesRepository.GetById(userId, null); } return(_saleRepository.GetActive().Select(s => s.AsToken(userPreferences, _productRepository.GetById(s.product_id)))); }