コード例 #1
0
        public async Task <IActionResult> Create([Bind("Id,Name,Birthdate,Email")] Client client)
        {
            if (ModelState.IsValid)
            {
                _context.Add(client);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(client));
        }
コード例 #2
0
        public async Task <IActionResult> Create([Bind("Id,Username,RealName,CreateDate,Level")] SystemUser systemUser)
        {
            if (ModelState.IsValid)
            {
                _context.Add(systemUser);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(systemUser));
        }
コード例 #3
0
        public async Task <IActionResult> Create([Bind("Id,CountryCode,AreaCode,Number")] Telephone telephone)
        {
            if (ModelState.IsValid)
            {
                _context.Add(telephone);
                await _context.SaveChangesAsync();

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