Пример #1
0
        public async Task <IActionResult> Create([Bind("Id,Name,Address,Postcode,Latitude,Longitude")] Place place)
        {
            if (ModelState.IsValid)
            {
                _context.Add(place);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(place));
        }
Пример #2
0
        public async Task <IActionResult> Create([Bind("Id,Password")] Account account)
        {
            if (ModelState.IsValid)
            {
                _context.Add(account);
                await _context.SaveChangesAsync();

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