示例#1
0
        public async Task <IActionResult> OnGetAsync(int?id)
        {
            if (id == null)
            {
                return(NotFound());
            }

            ScheduledStream stream = await _crudRepository.Get <ScheduledStream>(id.Value);

            if (stream == null)
            {
                return(NotFound());
            }

            ViewModel = stream.ToEditViewModel();
            ChannelId = stream.ChannelId;

            return(Page());
        }
示例#2
0
        public async Task <IActionResult> OnGetAsync(int?id)
        {
            if (id == null)
            {
                return(NotFound());
            }

            ScheduledStream scheduledStream = await _context.ScheduledStream
                                              .Include(x => x.Channel) // Required for "Back to List" link
                                              .FirstOrDefaultAsync(m => m.Id == id);

            if (scheduledStream == null)
            {
                return(NotFound());
            }

            ViewModel = scheduledStream.ToEditViewModel();
            ChannelId = scheduledStream.Channel.Id;

            return(Page());
        }