示例#1
0
        //[ValidateAntiForgeryToken]
        public async Task <IActionResult> Create([Bind("Id,Username,Email,Firstname,Lastname,ProfilePicture,Status")] Player playerModel)
        {
            if (ModelState.IsValid)
            {
                _context.Add(playerModel);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(playerModel));
        }
示例#2
0
        public async Task <IActionResult> Create([Bind("Id,Line1,Line2,City,state,ZipCode")] Address addressModel)
        {
            if (ModelState.IsValid)
            {
                _context.Add(addressModel);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(addressModel));
        }
示例#3
0
        public async Task <IActionResult> Create(
            [Bind("Id,Username,Email,Firstname,Lastname,Status")] UserModel userModel)
        {
            if (ModelState.IsValid)
            {
                _context.Add(userModel);
                await _context.SaveChangesAsync();

                return(RedirectToAction("Index"));
            }
            return(View(userModel));
        }