I see many similar questions, but with no direct answers. I have a List<ClientEntry> . I want to access properties in ClientEntry. My code is as follows:
class ClientEntry { private string _clientName; private string _clientEmail; public void ClientEntry(string name, string email) { this._clientName = name; this._clientEmail = email; } public string ClientName { get { return _clientName; } set { _clientName = value; } } public string ClientEmail { get { return _clientEmail; } set { RegexUtilities Validator = new RegexUtilities(); if (Validator.IsValidEmail(value)) { _clientEmail = value; } } } }
Further:
private List<ClientEntry> clientList;
Then I add the ClientEntry bunch to the list.
How can I access the ClientName and ClientEmail properties for items in the clientList? Also, how can I check for a specific ClientName or ClientEmail property in the list? Is this possible with a list of objects? I know that a dict will probably work better, but I wanted to see if this could be done with a list and a class with properties.
source share