コード例 #1
0
        public ChannelEditModel Get(int id)
        {
            if (id <= 0)
            {
                return(new ChannelEditModel());
            }

            var channel = _channelService.GetAggregate(id);

            var editModel = channel?.ToChannelEditModel();

            return(editModel);
        }
コード例 #2
0
        public async Task <IActionResult> OnGetAsync(int id)
        {
            var channel = _channelAggregateService.GetAggregate(id);

            Channel = channel.ToChannelViewModel();

            ScheduledStreams = channel.ScheduledStreams
                               .Select(x => x.ToViewModel())
                               .ToList();

            StreamSessions = (await _repo
                              .GetAll <StreamSession>("ChannelId = @id", new { id })).Take(5); // TODO: Limit closer to DB

            return(Page());
        }
コード例 #3
0
ファイル: Delete.cshtml.cs プロジェクト: skyhoshi/DevStreams
        public IActionResult OnGet(int?id)
        {
            if (id == null)
            {
                return(NotFound());
            }

            var model = _channelAggregateService.GetAggregate(id.Value);

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

            Channel = model.ToChannelViewModel();
            return(Page());
        }