Searching Custom Generic Lists

Discussion in 'ASP .Net' started by deathtospam@gmail.com, Nov 21, 2006.

  1. 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 =-
    , Nov 21, 2006
    #1
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Murat Tasan
    Replies:
    1
    Views:
    8,037
    Chaitanya
    Feb 3, 2009
  2. Replies:
    2
    Views:
    432
  3. =?UTF-8?B?w4FuZ2VsIEd1dGnDqXJyZXogUm9kcsOtZ3Vleg==

    List of lists of lists of lists...

    =?UTF-8?B?w4FuZ2VsIEd1dGnDqXJyZXogUm9kcsOtZ3Vleg==, May 8, 2006, in forum: Python
    Replies:
    5
    Views:
    398
    =?UTF-8?B?w4FuZ2VsIEd1dGnDqXJyZXogUm9kcsOtZ3Vleg==
    May 15, 2006
  4. jimxoch
    Replies:
    4
    Views:
    308
    jimxoch
    Jul 24, 2008
  5. stumblng.tumblr
    Replies:
    1
    Views:
    198
    stumblng.tumblr
    Feb 4, 2008
Loading...

Share This Page