Esempio n. 1
0
        public async Task <IActionResult> Create([Bind("Id,SubscriberName,Email")] Subscriber subscriber)
        {
            if (ModelState.IsValid)
            {
                _context.Add(subscriber);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(subscriber));
        }
Esempio n. 2
0
        public async Task <IActionResult> Create([Bind("Id,ChannelName,Established")] TVChannel tVChannel)
        {
            if (ModelState.IsValid)
            {
                _context.Add(tVChannel);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(tVChannel));
        }
Esempio n. 3
0
        public async Task <IActionResult> Create([Bind("Id,TVChannelId,ShowName")] TVShow tVShow)
        {
            if (ModelState.IsValid)
            {
                _context.Add(tVShow);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            ViewData["TVChannelId"] = new SelectList(_context.TVChannel, "Id", "Id", tVShow.TVChannelId);
            return(View(tVShow));
        }
        public async Task <IActionResult> Create([Bind("Id,SubscriberId,TVShowId,RatingValue")] Rating rating)
        {
            if (ModelState.IsValid)
            {
                _context.Add(rating);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            ViewData["SubscriberId"] = new SelectList(_context.Subscriber, "Id", "Id", rating.SubscriberId);
            ViewData["TVShowId"]     = new SelectList(_context.Set <TVShow>(), "Id", "Id", rating.TVShowId);
            return(View(rating));
        }