コード例 #1
0
 public async Task Create( EmployeeModel employeeModel)
 {
     
         _context.Add(employeeModel);
         await _context.SaveChangesAsync();
        
    
 }
コード例 #2
0
        public async Task <IActionResult> Create([Bind("Name,Email,Password,ConfirmPassword,Address,Phone")] RegisterModel registerModel)
        {
            if (ModelState.IsValid)
            {
                _context.Add(registerModel);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(HomeController.Index), "Home"));
            }
            return(RedirectToAction(nameof(HomeController.Index), "Home"));
        }
コード例 #3
0
        public async Task <IActionResult> Create([Bind("Name,RollNo,Class,Sec,EnglishM,MathsM,ScienceM,ID")] LqStudentModel lqStudentModel)
        {
            if (ModelState.IsValid)
            {
                _context.Add(lqStudentModel);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(lqStudentModel));
        }
コード例 #4
0
        public async Task <IActionResult> Create([Bind("ID,ProductName,ImgUrl,Price,Description")] LaptopModel laptopModel)
        {
            if (ModelState.IsValid)
            {
                _context.Add(laptopModel);
                await _context.SaveChangesAsync();

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