示例#1
0
        public async Task <IActionResult> Create([Bind("ApplicationId,UserName,FullName")] User user)
        {
            if (ModelState.IsValid)
            {
                user.Deleted = false;
                _context.Add(user);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index), new { appId = user.ApplicationId }));
            }
            return(View(User));
        }
示例#2
0
        public async Task <IActionResult> Create([Bind("ApplicationId,Name,Description")] Role role)
        {
            if (ModelState.IsValid)
            {
                role.Deleted = false;
                _context.Add(role);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index), new { appId = role.ApplicationId }));
            }
            return(View(role));
        }
        public async Task <IActionResult> Create([Bind("Name,Description")] Application application)
        {
            if (ModelState.IsValid)
            {
                application.Deleted = false;
                _context.Add(application);
                await _context.SaveChangesAsync();

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