Exemplo n.º 1
0
        public async Task GetByIdShouldReturnCorrectEvent()
        {
            await this.PopulateEvents();

            var service = new EventsService(
                this.eventsRepository,
                this.postsService,
                this.postRepository);

            var result = service.GetById <TestEventViewModel>(2);

            Assert.Equal("ccc", result.Title);
        }
Exemplo n.º 2
0
        public HttpResponseMessage GetById(int Id)
        {
            Events eventsData = EventsService.GetById(Id);

            User eventCreator = UserProfileServices.GetFullUserById(eventsData.UserId);

            eventsData.Organizer = eventCreator.UserMini;

            ItemResponse <Events> response = new ItemResponse <Events>();

            response.Item = eventsData;


            return(Request.CreateResponse(HttpStatusCode.OK, response));
        }