public bool RemoveAssociatedPart(int partNo) { var part = AssociatedParts.FirstOrDefault(x => x.PartId == partNo); if (part != null) { AssociatedParts.Remove(part); } return(part != null); }
public bool RemoveAssociatedPart(int id) { var part = LookupAssociatedPart(id); if (part == null) { return(false); } return(AssociatedParts.Remove(part)); }
public bool RemoveAssociatePart(int partId) { var partToRemove = AssociatedParts.Where(x => x.PartId == partId).FirstOrDefault(); if (partToRemove == null) { return(false); } AssociatedParts.Remove(partToRemove); return(true); }
public bool removeAssociatedPart(int id) { var partToDelete = AssociatedParts.SingleOrDefault(x => x.PartID == id); if (partToDelete != null) { AssociatedParts.Remove(partToDelete); return(true); } else { return(false); } }
public static bool RemoveAssociatedPart(int partID) { Part part = LookupAssociatedPart(partID); if (part == null) { return(false); } else { AssociatedParts.Remove(part); return(true); } }
public bool RemoveAssociatedPart(int partID) { bool success = false; foreach (Part part in AssociatedParts) { if (part.PartID == partID) { AssociatedParts.Remove(part); return(success = true); } else { success = false; } } return(success); }