Пример #1
0
        public IActionResult ListResponses()
        {   // responses Type is List<GuestResponse>  = Repository is calling GetResponse Method
            List <GuestResponse> responses = Repository.GetResponses();
            List <GuestResponse> willAttend
                = responses.Where(r => r.WillAttend == true).ToList();  // LINQ - Language Integrated Query. Also try (OrderBy(r=>r.Name).ToList();

            return(View(responses));
        }
Пример #2
0
        public IActionResult ListResponses()
        {
            List <GuestResponse> responses = Repository.GetResponses();
            List <GuestResponse> willAttend
                = responses.Where(responses => responses.WillAttend == true)
                  .OrderBy(responses => responses.Name)
                  .ToList();          //LInQ Lanuage Integrated Query

            return(View(willAttend));
        }
Пример #3
0
        public IActionResult ListResponses()
        {
            List <GuestResponse> responses = Repository.GetResponses();

            return(View(responses));
        }