Example #1
0
        public async Task <IActionResult> CreateNation(Nation nation)
        {
            var userId      = User.FindFirst(ClaimTypes.NameIdentifier)?.Value;
            var currentUser = await _userManager.FindByIdAsync(userId);

            nation.SetProperties();

            _db.Nations.Add(nation);
            _db.SaveChanges();
            return(RedirectToAction("Index"));
        }
Example #2
0
        public IActionResult NewDestination(string newCity, string newCountry)
        {
            Destination newDestination = new Destination(newCity, newCountry);

            db.Destinations.Add(newDestination);
            db.SaveChanges();
            return(Json(newDestination));
        }