Exemplo n.º 1
0
        // GET: Events/Details/5
        public Event GetEventByID(int?id)
        {
            if (id == null)
            {
                return(null);
            }
            MyGlobals.SetEventID((int)id);
            MyGlobals.SetEventName(GetCurrentEventName());

            var item = _context.Event.FirstOrDefault(i => i.Id == id);

            return(item);
        }
Exemplo n.º 2
0
        // GET: Events/Details/5
        public async Task <IActionResult> Details(int?id)
        {
            if (id == null)
            {
                return(NotFound());
            }

            var @event = await _context.Event
                         .FirstOrDefaultAsync(m => m.Id == id);

            MyGlobals.SetEventID((int)id);
            MyGlobals.SetEventName(GetCurrentEventName());
            if (@event == null)
            {
                return(NotFound());
            }

            return(PartialView(@event));
        }