예제 #1
0
        public HttpResponseMessage GetById(int id)
        {
            ItemResponse <Meeting> response = new ItemResponse <Meeting>();

            response.Item = _meetingsService.GetById(id);
            return(Request.CreateResponse(response));
        }
예제 #2
0
        public void GetById_GivenExistingId_ReturnsExpectedMeeting()
        {
            // Arrange
            var id      = Guid.NewGuid();
            var meeting = new Meeting {
                Id = id, Name = "Test meeting"
            };

            _repoMock.Setup(x => x.Get(id)).Returns(meeting);

            // Act
            var result = _meetingService.GetById(id);

            // Assert
            Assert.AreEqual(meeting.Name, result.Name);
        }
예제 #3
0
        public MeetingWebModel Get(Guid meetingId)
        {
            var model  = _meetingService.GetById(meetingId);
            var result = Mapper.Map <MeetingWebModel>(model);

            return(result);
        }
예제 #4
0
        // GET: api/Meeting/5

        public Meeting Get(int id)
        {
            return(_meetingService.GetById(id));
        }
        public IActionResult GetById(int id)
        {
            var meeting = _meetingService.GetById(id);

            return(Ok(meeting));
        }