Пример #1
0
        // GET: QueueMembers
        public async Task <IActionResult> Index(int?consultationId)
        {
            var consultations = await _consultationService.GetAllAsync();

            var query = consultations.Select(c => new {
                Id          = c.Id,
                DisplayText = String.Format("{0} {1} {2} {3}", c.Lecturer.FirstName, c.Lecturer.SecondName, c.Subject.Name, c.Date)
            });

            ViewData["ConsultationId"] = new SelectList(query, "Id", "DisplayText");

            if (consultationId is null)
            {
                return(View(await _service.GetAllAsync()));
            }

            var members = await _service.GetAllAsync();

            return(View(members.Where(m => m.Queue.ConsultationId == consultationId)));
        }
Пример #2
0
        public async Task GetAll_ReturnsAllEntities()
        {
            // Arrange
            var expectedCount = await _context.QueueMembers.CountAsync();

            // Act
            var resultCount = _queueMemberService.GetAllAsync();

            // Assert

            resultCount.Result.Count().Should().Be(expectedCount);
        }
Пример #3
0
 public async Task <ActionResult <IEnumerable <QueueMemberDTO> > > GetAll()
 => Ok(await _queueMemberService.GetAllAsync());