예제 #1
0
        public async Task <IActionResult> Create([Bind("IdUser,Nama,Email,Password")] User user)
        {
            if (ModelState.IsValid)
            {
                _context.Add(user);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(user));
        }
예제 #2
0
        public async Task <IActionResult> Create([Bind("IdReview,Nama,Review1")] Review review)
        {
            if (ModelState.IsValid)
            {
                _context.Add(review);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(review));
        }
예제 #3
0
        public async Task <IActionResult> Create([Bind("IdAdmin,Nama,Email,Password,NoHp")] Admin admin)
        {
            if (ModelState.IsValid)
            {
                _context.Add(admin);
                await _context.SaveChangesAsync();

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