How to count items that are equal to a certain value and place it in a label ?
class Conversation
{
public string Id { get; set; }
public int Readen { get; set; }
public string Recipient { get; set; }
}
In Readen property, there are values that are equal to "1" or to "0". How to count every Readen that is equal to "1" ?
Update;
tried this calling after Conversation is filled:
private void CountUnread() {
int i = 0;
Conversation cs = new Conversation();
if (cs.Readen == "1") {
i++;
}
MessageBox.Show(i.ToString());
}
MessageBox shows zero