Exemplo n.º 1
0
 public CreateSession(DatabaseFixture fixture)
 {
     _fixture = fixture;
     _model   = new CreateSessionBindingModel
     {
         FilmId   = _fixture.SeedData.Films.First().Id,
         ScreenId = _fixture.SeedData.Cinema.Screens.First().Id,
         Start    = DateTime.Today.AddDays(1).AddHours(17)
     };
 }
Exemplo n.º 2
0
        public async Task <IHttpActionResult> CreateSession(
            int cinemaId,
            CreateSessionBindingModel model)
        {
            var response = await _mediator.Send(new CreateSessionCommand(
                                                    cinemaId : cinemaId,
                                                    screenId : model.ScreenId,
                                                    filmId : model.FilmId,
                                                    start : model.Start));

            var url = Url.Route("GetSession", new { CinemaId = cinemaId, SessionId = response.Session.SessionId });

            return(Created(url, response.Session));
        }