Example #1
0
        private GameNightService CreateGameNightService()
        {
            var userId  = Guid.Parse(User.Identity.GetUserId());
            var service = new GameNightService(userId);

            return(service);
        }
Example #2
0
        public IHttpActionResult Get(int id)
        {
            GameNightService gameNightService = CreateGameNightService();
            var gameNight = gameNightService.GetGameNightById(id);

            return(Ok(gameNight));
        }
Example #3
0
        public IHttpActionResult GetAll()
        {
            GameNightService gameNightService = CreateGameNightService();
            var gameNights = gameNightService.GetGameTimes();

            return(Ok(gameNights));
        }
Example #4
0
        // GET: GameNight
        public ActionResult Index()
        {
            var userId  = Guid.Parse(User.Identity.GetUserId());
            var service = new GameNightService(userId);
            var model   = service.GetGameTimes();

            return(View(model));
        }