示例#1
0
        public async Task <IActionResult> Create([Bind("Id,Brand,Model,Price,Image")] Phone phone)
        {
            if (ModelState.IsValid)
            {
                _context.Add(phone);
                await _context.SaveChangesAsync();

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