I have following lines of code, According to Command List Item, it should goes into if block, but it is not going there. In debug mode int[] ckeys
shows just {int[0]}
not any value, can you tell me what is the problem?
List<string> Command=new List<string>();
string ASCLICAL = "Callers:";
string ASCLIMEM= "Members:";
string ASCLINOCAL="NoCallers";
int[] ckeys = Command.Select((s, idx) => new { Str = s, Idx = idx })
.Where(p => p.Str == ASCLICAL)
.Select(p => p.Idx)
.ToArray();
if(ckeys == null) {
ckeys = Command.Select((s, idx) => new { Str = s, Idx = idx })
.Where(p => p.Str == ASCLINOCAL)
.Select(p => p.Idx)
.ToArray();
}
Command List Contains:
[0] = "300 has 0 calls (max unlimited) in 'ringall' strategy (173s holdtime), W:0, C:1, A:0, SL:0.0% within 0s"
[1] = "Members:"
[2] = "Local/409@from-internal/n (In use) has taken 1 calls (last was 64167 secs ago)"
[3] = "No Callers"
[4] = ""