Exemplo n.º 1
0
        public async Task <IActionResult> Create([Bind("BranchId,City,Head,Address")] Branch branch)
        {
            if (ModelState.IsValid)
            {
                _context.Add(branch);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(branch));
        }
Exemplo n.º 2
0
        public async Task <IActionResult> Create([Bind("MemberId,Name,Birthday,Address")] Member member)
        {
            if (ModelState.IsValid)
            {
                _context.Add(member);
                await _context.SaveChangesAsync();

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