Example #1
0
        /// <summary>
        /// Gets Customer based on CustomerName.
        /// </summary>
        /// <param name="CustomerName">Represents CustomerName to search.</param>
        /// <returns>Returns Customer object.</returns>
        public override List <Customer> GetCustomersByNameDAL(string CustomerName)
        {
            List <Customer> matchingCustomers = new List <Customer>();

            try
            {
                //Find All Customers based on CustomerName
                matchingCustomers = CustomerList.FindAll(
                    (item) => { return(item.CustomerName.Equals(CustomerName, StringComparison.OrdinalIgnoreCase)); }
                    );
            }
            catch (System.Exception)
            {
                throw;
            }
            return(matchingCustomers);
        }