private GameNightService CreateGameNightService() { var userId = Guid.Parse(User.Identity.GetUserId()); var service = new GameNightService(userId); return(service); }
public IHttpActionResult Get(int id) { GameNightService gameNightService = CreateGameNightService(); var gameNight = gameNightService.GetGameNightById(id); return(Ok(gameNight)); }
public IHttpActionResult GetAll() { GameNightService gameNightService = CreateGameNightService(); var gameNights = gameNightService.GetGameTimes(); return(Ok(gameNights)); }
// GET: GameNight public ActionResult Index() { var userId = Guid.Parse(User.Identity.GetUserId()); var service = new GameNightService(userId); var model = service.GetGameTimes(); return(View(model)); }