コード例 #1
0
        public async Task <IActionResult> Create([Bind("ID,Y,X1,X2,X3,X4,X5,X6")] DataPoint dataPoint)
        {
            if (ModelState.IsValid)
            {
                _context.Add(dataPoint);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(dataPoint));
        }
コード例 #2
0
        public async Task <IActionResult> Create([Bind("ID,Name,Percentage1,Percentage2,Percentage3,Percentage4,Percentage5,Percentage6,Created")] DataModel dataModel)
        {
            if (ModelState.IsValid)
            {
                _context.Add(dataModel);
                await _context.SaveChangesAsync();

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