public HttpResponseMessage GetById(int id) { ItemResponse <Meeting> response = new ItemResponse <Meeting>(); response.Item = _meetingsService.GetById(id); return(Request.CreateResponse(response)); }
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); }
public MeetingWebModel Get(Guid meetingId) { var model = _meetingService.GetById(meetingId); var result = Mapper.Map <MeetingWebModel>(model); return(result); }
// 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)); }