I am trying to come up with a way to only add a part number if it does not exist. Can you give the best way to do this below using the
part number object?
colorfile.PartNumbers.Add(new Color_PartNumber() { colorNumber = colorPartNumber.partNumber });
Loading
VulpesPosted Aug 1, 2013, 5:01 AM
I can't see any alternative to looking through the PartNumbers collection to see whether there's already a Color_PartNumber object whose colorNumber property is equal to the proposed new value.
In fact, it would be more efficient to do this using 'normal' code rather than LINQ as you can break immediately when an existing duplicate is found rather than carrying on and looking for more.
VulpesPosted Aug 1, 2013, 5:24 AM
David SmithPosted Jul 31, 2013, 7:46 PM
David SmithPosted Jul 31, 2013, 7:31 PM
Also can you check out my last thread before this, I am trying to rewrite that entire method. I am trying to come up with a way of not using the array elements. I want to do the incrementing. I try to stay away from incrementing. thats c++ mentality. Check out my last thread call Save XML data to File
VulpesPosted Jul 31, 2013, 7:22 PM