Link to home
Start Free TrialLog in
Avatar of mousemat24
mousemat24

asked on

How to I add a new value based on a change of value

Hi there

How to I add a new value based on a change of value?

I have this code

 foreach (var item in itemAttributes)
        {            
            string fID = GetBook("Programming");
            var attributes = from a in itemAttributes
                             where a.Description.ToLower().Contains("ID='" + fID + "'")

            SearchBookCollection values = new SearchBookCollection();
            values.AddRange(attributes.ToList());
        }

What I want is if fID are different ONLY run

values.AddRange(attributes.ToList());

Hope this makes sense?

thanks
ASKER CERTIFIED SOLUTION
Avatar of Arthur_Wood
Arthur_Wood
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial