Example #1
0
        public override Task <GetAllConferencesResponse> GetAll(
            GetAllConferencesRequest request, ServerCallContext context)
        {
            var result = new GetAllConferencesResponse();

            result.Conferences.Add(repo.GetAll());
            return(Task.FromResult(result));
        }
Example #2
0
        public IActionResult GetAll()
        {
            var conferences = repo.GetAll();
            if (!conferences.Any())
                return new NoContentResult();

            return new ObjectResult(conferences);
        }
Example #3
0
        public StatisticModel GetStatistics()
        {
            var conferences = conferenceRepo.GetAll();

            return(new StatisticModel
            {
                AverageConferenceAttendees = (int)conferences.Average(x => x.AtendeeTotal),
                NumberOfAttendees = conferences.Sum(x => x.AtendeeTotal)
            });
        }
Example #4
0
        public async Task <StatisticsModel> GetStatistics()
        {
            var conferences = await _conferenceRepo.GetAll();

            return(new StatisticsModel
            {
                NumberOfAttendees = conferences.Sum(c => c.AttendeeTotal),
                AverageConferenceAttendees = (int)conferences.Average(c => c.AttendeeTotal)
            });
        }
Example #5
0
        public async Task <IActionResult> GetAll()
        {
            var conferences = await _repo.GetAll();

            if (!conferences.Any())
            {
                return(new NoContentResult());
            }

            return(new ObjectResult(conferences));
        }