Ejemplo n.º 1
0
        public async Task <IActionResult> Create([Bind("iD,Brand,Name,batteryLife,LaunchDate,phoneWeight,phoneOS,phoneCPU,phoneDisplay,phoneRating,phoneImage")] Phone phone)
        {
            if (ModelState.IsValid)
            {
                _context.Add(phone);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(phone));
        }
Ejemplo n.º 2
0
        public async Task <IActionResult> Create([Bind("Id,Brand,ReleaseDate,Rating,Price")] Phone phone)
        {
            if (ModelState.IsValid)
            {
                _context.Add(phone);
                await _context.SaveChangesAsync();

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