// GET: Home public ActionResult Index() { return(View(new HomeViewModel { Events = _events.Get(), Exhibits = _exhibits.Get() })); }
public HttpResponseMessage Get(Events model) { List <Events> eventsData = EventsService.Get(model); ItemsResponse <Events> response = new ItemsResponse <Events>(); response.Items = eventsData; return(Request.CreateResponse(HttpStatusCode.OK, response)); }
public void TestGetAll() { // Arrange EventsService service = Scope.Resolve <EventsService>(); // Act IEnumerable <Event> result = service.Get(); // Assert Assert.IsTrue(_events.Except(result).Count() == 0); }
public void TestGetById() { // Arrange EventsService service = Scope.Resolve <EventsService>(); // Act Event result = service.Get(_events.First().EventID); // Assert Assert.IsNotNull(result); }
public ActionResult <IEnumerable <Event> > Get() { try { return(Ok(_es.Get())); } catch (Exception e) { return(BadRequest(e.Message)); }; }
public HttpResponseMessage Get([FromUri] EventsGetRequest GetEvents) { List <Events> eventsData = EventsService.Get(GetEvents); ItemsResponse <Events> response = new ItemsResponse <Events>(); response.Items = eventsData; return(Request.CreateResponse(HttpStatusCode.OK, response)); }
public IHttpActionResult Get(int id) { try { return(Ok(EventsService.Get(id).Select(e => new { e.MemberId, e.Member.FirstName, e.Member.LastName, e.Credit }))); } catch (Exception e) { return(NotFound()); } }
public IHttpActionResult Get() { try { return(Ok(EventsService.Get().Select(e => new { e.Id, e.Association.Name }))); } catch (Exception) { return(NotFound()); } }
public async Task Get_QueryIncludesAfter_RetrievesCorrectNumberOfEvents() { // Arrange int expectedCount = 3; EventsService eventsService = new EventsService(new PostgresRepositoryMock(2)); // Act List <CloudEvent> actual = await eventsService.Get("e31dbb11-2208-4dda-a549-92a0db8c8808", null, null, 0, new List <string>() { }, new List <string>() { }); // Assert Assert.Equal(expectedCount, actual.Count); }
public async Task Get_QueryIncludesFromAndPartyId_RetrievesCorrectNumberOfEvents() { // Arrange int expectedCount = 1; string expectedSubject = "/party/54321"; EventsService eventsService = new EventsService(new PostgresRepositoryMock(2)); // Act List <CloudEvent> actual = await eventsService.Get(string.Empty, new DateTime(2020, 06, 17), null, 54321, new List <string>() { }, new List <string>() { }); // Assert Assert.Equal(expectedCount, actual.Count); Assert.Equal(expectedSubject, actual.First().Subject); }
public ActionResult Index() { return(View(_events.Get())); }
public async Task <IActionResult> Get(string id) { var sportsmanDto = await _eventService.Get(id); return(Ok(new { Success = true, Event = sportsmanDto })); }