Exemplo n.º 1
0
        public async Task <IActionResult> SignUp([Bind("Id,FirstName,LastName,Nickname,ContactNumber,ContactEmail,SocialMedia,BusinessInfo,Username,Password")] SignUp item)
        {
            if (ModelState.IsValid)
            {
                _context.Add(item);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(item));
        }
Exemplo n.º 2
0
        public async Task <IActionResult> Create([Bind("Id,Title,RestockDate,InStock,Price,UserId")] InventoryTracker item)
        {
            if (ModelState.IsValid)
            {
                item.UserId = _userManager.GetUserId(User);
                _context.Add(item);
                await _context.SaveChangesAsync();

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