public async Task <IActionResult> Create([Bind("Id,PersonId,CityId")] Citizenship citizenship)
        {
            if (ModelState.IsValid)
            {
                _context.Add(citizenship);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(citizenship));
        }
예제 #2
0
        public async Task <IActionResult> Create([Bind("Id,Smile,Beauty,Nature,Character,Communication,Humor,OfPersonId,ByPersonId")] Quality quality)
        {
            if (ModelState.IsValid)
            {
                _context.Add(quality);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(quality));
        }
예제 #3
0
        public async Task <IActionResult> Create([Bind("Id,FirstPersonId,SecondPersonId")] FriendEntry friendEntry)
        {
            if (ModelState.IsValid)
            {
                _context.Add(friendEntry);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(friendEntry));
        }
예제 #4
0
        public async Task <IActionResult> Create([Bind("Id,Name,Surname,Gender,DateTimeOfBirth")] Person person)
        {
            if (ModelState.IsValid)
            {
                _context.Add(person);
                await _context.SaveChangesAsync();

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