예제 #1
0
        public async Task <IActionResult> Create([Bind("Id,AreaName,AreaCaption,ControllerName,ControllerCaption,ActionName,ActionCaption,ActionType")] Permissions permissions)
        {
            if (ModelState.IsValid)
            {
                _context.Add(permissions);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(permissions));
        }
예제 #2
0
        public async Task <IActionResult> Create([Bind("Id,UserName,Password,PasswordSalt,IsActive,CreateDate")] Users users)
        {
            if (ModelState.IsValid)
            {
                users.Id         = Guid.NewGuid();
                users.CreateDate = DateTime.Now;
                _context.Add(users);
                await _context.SaveChangesAsync();

                _cache.Remove(_userListCacheKey);

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