コード例 #1
0
 public async Task <IActionResult> Create([Bind("ClientId,ClientName")] Client client)
 {
     if (ModelState.IsValid)
     {
         _context.Add(client);
         await _context.SaveChangesAsync();
     }
     return(RedirectToAction("Manage", "Repo"));
 }
コード例 #2
0
        public async Task <IActionResult> Create([Bind("UserId,UserName")] User user)
        {
            if (ModelState.IsValid)
            {
                _context.Add(user);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(user));
        }
コード例 #3
0
        public async Task <IActionResult> Create([Bind("ClientId,ClientName")] Client client)
        {
            if (ModelState.IsValid)
            {
                _context.Add(client);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(client));
        }
コード例 #4
0
        public async Task <IActionResult> Create([Bind("ProjectId,ProjectName,ClientId")] Project project)
        {
            if (ModelState.IsValid)
            {
                _context.Add(project);
                await _context.SaveChangesAsync();

                return(RedirectToAction("Manage", "Repo"));
            }
            ViewData["ClientId"] = new SelectList(_context.Clients, "ClientId", "ClientName", project.ClientId);
            return(View(project));
        }
コード例 #5
0
        public async Task <IActionResult> Create([Bind("DacpacId,DacpacName,DatabaseId")] Dacpac dacpac)
        {
            if (ModelState.IsValid)
            {
                _context.Add(dacpac);
                await _context.SaveChangesAsync();

                return(RedirectToAction("Manage", "Repo"));
            }
            ViewData["DatabaseId"] = new SelectList(_context.Databases, "DatabaseId", "DatabaseName", dacpac.DatabaseId);
            return(RedirectToAction("Manage", "Repo"));
        }
コード例 #6
0
        public async Task <IActionResult> Create([Bind("InstanceId,InstanceName,ProjectId")] Instance instance)
        {
            if (ModelState.IsValid)
            {
                _context.Add(instance);
                await _context.SaveChangesAsync();

                return(RedirectToAction("Manage", "Repo"));
            }
            ViewData["ProjectId"] = new SelectList(_context.Projects, "ProjectId", "ProjectName", instance.ProjectId);
            return(View(instance));
        }
コード例 #7
0
        public async Task <IActionResult> Create([Bind("DatabaseId,DatabaseName,InstanceId")] Database database)
        {
            if (ModelState.IsValid)
            {
                _context.Add(database);
                await _context.SaveChangesAsync();

                return(RedirectToAction("Manage", "Repo"));
            }
            ViewData["InstanceId"] = new SelectList(_context.Instances, "InstanceId", "InstanceName", database.InstanceId);
            return(View(database));
        }