コード例 #1
0
        public async Task <IActionResult> Create([Bind("Id,IdCategory,IdOwner,Quantity,PriceQuant,QuantMinSell,Status")] Actions actions)
        {
            if (ModelState.IsValid)
            {
                _context.Add(actions);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(actions));
        }
コード例 #2
0
        public async Task <IActionResult> Create([Bind("id,name,email,password")] Client client)
        {
            if (ModelState.IsValid)
            {
                _context.Add(client);
                await _context.SaveChangesAsync();

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

                return(RedirectToAction(nameof(Index)));
            }
            return(View(category));
        }
コード例 #4
0
        public async Task <IActionResult> Create([Bind("Id,Name,Email,Password,Admin")] Clients clients)
        {
            if (ModelState.IsValid)
            {
                _context.Add(clients);
                await _context.SaveChangesAsync();

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