All pastes #2050873 Raw Edit

Something

public text v1 · immutable
#2050873 ·published 2011-04-26 14:10 UTC
rendered paste body
 static void Main(string[] args)
        {
            List<PingReply> PingReplies = new List<PingReply> { 
                new PingReply { Status = 1 },
                new PingReply { Status = 1 },
                new PingReply { Status = 1 },
                new PingReply { Status = 8 },
                new PingReply { Status = 8 },
                new PingReply { Status = 8 },
                new PingReply { Status = 8 },
                new PingReply { Status = 8 }
            };

            IEnumerable<PingReply> lastFive = PingReplies.Take(5);
            int num = lastFive.Where(a => a.Status != 1).Count(); //shows 2
            if (lastFive.Where(a => a.Status != 1).Count() == 5)
            {
                Console.WriteLine(" may be down");
            }

            Console.ReadLine();
        }



        private class PingReply
        {
            public int Status { get; set; }
        }