예제 #1
0
      public async Task <IActionResult> Create([Bind("VideoID,VideoName,VideoNum,VideoURL")] Video video)
      {
          if (ModelState.IsValid)
          {
              _context.Add(video);
              await _context.SaveChangesAsync();

              return(RedirectToAction(nameof(Index)));
          }
          return(View(video));
      }
예제 #2
0
        public async Task <IActionResult> Create([Bind("ID,Name,Author,Publisher,ISBN,Details,Rank,Price,ImageUrl")] Book book)
        {
            if (ModelState.IsValid)
            {
                _context.Add(book);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(book));
        }
예제 #3
0
      public async Task <IActionResult> Create([Bind("PostId,Title,Content,Time")] Post post)
      {
          if (ModelState.IsValid)
          {
              _context.Add(post);
              await _context.SaveChangesAsync();

              return(RedirectToAction(nameof(Index)));
          }
          return(View(post));
      }
예제 #4
0
        public async Task <IActionResult> Create([Bind("BlogId,BlogUrl,BlogAuthor")] Blog blog)
        {
            if (ModelState.IsValid)
            {
                _context.Add(blog);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(blog));
        }