Exemplo n.º 1
0
        public async Task <IActionResult> Create([Bind("ID,Administrator,RowVersion,FirstName,LastName,PhoneNumber,Email")] Employee employee)
        {
            if (ModelState.IsValid)
            {
                _context.Add(employee);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(employee));
        }
Exemplo n.º 2
0
        public async Task <IActionResult> Create([Bind("ID,Name,Description,Price")] Product product)
        {
            if (ModelState.IsValid)
            {
                _context.Add(product);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(product));
        }
Exemplo n.º 3
0
        public async Task <IActionResult> Create([Bind("ID,Active,RowVersion")] Subscriber subscriber)
        {
            if (ModelState.IsValid)
            {
                _context.Add(subscriber);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(subscriber));
        }
        public async Task <IActionResult> Create([Bind("ID,Email,PhoneNumber,FirstName,LastName,Active")] Subscriber subscriber)
        {
            if (ModelState.IsValid)
            {
                _context.Add(subscriber);
                await _context.SaveChangesAsync();

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