Searching Custom Generic Lists

G

Guest

I have a class called StoredProcedureInfo that has four get/set
properties: ID, Name, Text and IsChecked. I have created a generic
list of this class, populated it and now want to make sure certain
values exist in it.

===================================
protected List<StoredProcedureInfo> storedProcedureList = new
List<StoredProcedureInfo>();
===================================

In a simpler generic list -- for example, List<int> -- I would do this
by calling List<int>.Contains() or List<int>.IndexOf() . But how would
I do this in a more complex, custom class like mine? I'm attaching my
class declaration code below, in case it helps... any help or advince
would be appreciated!

===================================
public class StoredProcedureInfo {
private int databaseObjectId = 0;
private string storedProcedureName = null;
private string storedProcedureCreateStatement = null;
private bool isChecked = false;

// Constructors
public StoredProcedureInfo(int DatabaseObjectId, string
StoredProcedureName, string CreateProcedureText, bool IsChecked) {
this.StoredProcedureID = DatabaseObjectId;
this.StoredProcedureName = StoredProcedureName;
this.StoredProcedureText = CreateProcedureText;
this.IsStoredProcedureChecked = IsChecked;
}
public StoredProcedureInfo(int DatabaseObjectId, string
StoredProcedureName, string CreateProcedureText) :
this(DatabaseObjectId, StoredProcedureName, CreateProcedureText, false)
{ }
public StoredProcedureInfo() { }

// Properties
public int StoredProcedureID {
get { return databaseObjectId; }
private set { databaseObjectId = value; }
}
public string StoredProcedureName {
get { return storedProcedureName; }
private set { storedProcedureName = value; }
}
public string StoredProcedureText {
get { return storedProcedureCreateStatement; }
private set { storedProcedureCreateStatement = value; }
}
public bool IsStoredProcedureChecked {
get { return isChecked; }
private set { isChecked = value; }
}
}
===================================


-= Tek Boy =-
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,480
Members
44,900
Latest member
Nell636132

Latest Threads

Top