public async Task <IActionResult> Create([Bind("Id,FirstName,LastName,Location_IdLocation,username,passwords")] UserInfo userInfo)
        {
            if (ModelState.IsValid)
            {
                _context.Add(userInfo);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(userInfo));
        }
Esempio n. 2
0
        public async Task <IActionResult> Create([Bind("Id,Name,CreateTime")] UserInfoDto userInfoDto)
        {
            if (ModelState.IsValid)
            {
                userInfoDto.Id = Guid.NewGuid();
                _context.Add(userInfoDto);
                await _context.SaveChangesAsync();

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