/// <summary> /// Removes class from list by primary key /// </summary> public bool Remove(int imageId) { bool result = false; SliderImagePrimaryKey key = new SliderImagePrimaryKey(); key.ImageId = imageId; if (m_Items.ContainsKey(key)) { result = Remove(m_Items[key]); } return(result); }
/// <summary> /// Finds class by primary key /// </summary> public SliderImage Find(int imageId) { SliderImage result = null; SliderImagePrimaryKey key = new SliderImagePrimaryKey(); key.ImageId = imageId; if (m_Items.ContainsKey(key)) { result = m_Items[key]; } return(result); }
/// <summary> /// Finds class by primary key /// </summary> public SliderImage Find(int imageId) { SliderImage result = null; SliderImagePrimaryKey key = new SliderImagePrimaryKey(); key.ImageId = imageId; // Loop through our list until we find the match foreach (SliderImage item in m_Items) { if (item.PrimaryKey.CompareTo(key) == 0) { result = item; break; } } return(result); }
/// <summary> /// Removes class from list by primary key values /// </summary> public bool Remove(int imageId) { bool result = false; SliderImagePrimaryKey key = new SliderImagePrimaryKey(); key.ImageId = imageId; // Loop through our list until we find the match for (int i = 0; i < m_Items.Count; i++) { if (m_Items[i].PrimaryKey.CompareTo(key) == 0) { m_Items.RemoveAt(i); result = true; break; } } return(result); }