public ActionResult Index(int?minSessions)
        {
            minSessions ??= 0;
            var list = (from conf in repository.GetAllConferences()
                        where conf.SessionCount >= minSessions
                        select new ConferenceListModel
            {
                Id = conf.Id,
                Name = conf.Name,
                SessionCount = conf.SessionCount,
                AttendeeCount = conf.AttendeeCount
            }).ToArray();

            return(View(list));
        }
Exemple #2
0
            public Task <Response> Handle(Query request, CancellationToken cancellationToken)
            {
                request.MinSessions ??= 0;
                var list = (from conf in repository.GetAllConferences()
                            where conf.SessionCount >= request.MinSessions
                            select new ConferenceModel()
                {
                    Id = conf.Id,
                    Name = conf.Name,
                    SessionCount = conf.SessionCount,
                    AttendeeCount = conf.AttendeeCount
                }).ToList();

                return(Task.FromResult(new Response
                {
                    Conferences = list
                }));
            }
 public virtual IEnumerable <ConferenceListDto> GetConferences([FromQuery] string filter, [FromQuery] string sort)
 {
     return(_conferenceRepository.GetAllConferences());
 }