public async Task <IActionResult> Create([Bind("BlogID,Date,Cmt")] Blog blog)
        {
            if (ModelState.IsValid)
            {
                _context.Add(blog);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(blog));
        }
Example #2
0
        public async Task <IActionResult> Create([Bind("PortfolioID,Img,Link,Tech,Cmt")] Portfolio portfolio)
        {
            if (ModelState.IsValid)
            {
                _context.Add(portfolio);
                await _context.SaveChangesAsync();

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