public Product[] GetProducts(Customer customer) { int[] ids = productDataAccess.GetProductIds(); if (ids.Length == 0) { return(new Product[0]); } // We select two int firstIndex = random.Next(0, ids.Length - 1); int secondIndex = random.Next(0, ids.Length - 1); if (firstIndex != secondIndex) { return(new Product[] { Product.Find(ids[firstIndex]), Product.Find(ids[secondIndex]) }); } else { return(new Product[] { Product.Find(ids[firstIndex]) }); } }