public IQueryable <ProductRelatedMap> GetRelatedProductMap() { List <ProductRelatedMap> result = new List <ProductRelatedMap>(); for (int i = 1; i <= 5; i++) { for (int x = 1; x <= 5; x++) { ProductRelatedMap map = new ProductRelatedMap(); map.ProductID = i; map.RelatedProductID = x; if (i != x) { result.Add(map); } } } return(result.AsQueryable()); }
public IQueryable<ProductRelatedMap> GetRelatedProductMap() { List<ProductRelatedMap> result = new List<ProductRelatedMap>(); for (int i = 1; i <= 5; i++) { for (int x = 1; x <= 5; x++) { ProductRelatedMap map = new ProductRelatedMap(); map.ProductID = i; map.RelatedProductID = x; if(i!=x) result.Add(map); } } return result.AsQueryable(); }