コード例 #1
0
        public async Task <IActionResult> Create([Bind("AppID,AppName,AppURL,AppDescription,AppStatus,DateCreated")] Application application)
        {
            if (ModelState.IsValid)
            {
                _context.Add(application);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(application));
        }
コード例 #2
0
        public async Task <IActionResult> PostChecklist([FromBody] Checklist checklist)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            _context.Checklists.Add(checklist);
            await _context.SaveChangesAsync();

            return(CreatedAtAction("GetChecklist", new { id = checklist.Id }, checklist));
        }