using Gremlin.GremlinData.EntityClasses;
using System.Collections.Generic;

namespace Gremlin.Operations
{
    internal class ProductOperations
    {
        public static Product SearchForProduct(LineItem lineItem, List<Product> productList)
        {
            List<Product> resultsProduct = productList.FindAll(pL => pL.ProductNumber == lineItem.ProductNumber);
            return resultsProduct.Find(pL => pL.OptionNumber == lineItem.OptionNumber);
        }

        public static List<Product> SearchForProducts(List<Product> productList, string search)
        {
            return productList.FindAll(pL => pL.ProductNumber == search);
        }
    }
}