Exemplo n.º 1
0
        public IActionResult Create(string newDestination, string newDescription)
        {
            Suggestion newSuggestion = new Suggestion(newDestination, newDescription);

            suggestionRepo.Save(newSuggestion);
            return(Json(newSuggestion));
        }
 public IActionResult Create(Suggestion suggestion, int locationId)
 {
     //Location location = suggestionRepo.Locations.FirstOrDefault(l => l.LocationId == locationId);
     //string userId = User.FindFirst(ClaimTypes.NameIdentifier)?.Value;
     //ApplicationUser user = suggestionRepo.Users.FirstOrDefault(u => u.Id == userId);
     //suggestion.Location = location;
     //suggestion.AppUser = user;
     suggestionRepo.Save(suggestion);
     return(RedirectToAction("Index", "Locations"));
 }
 public IActionResult Create(Suggestion suggestion)
 {
     suggestionRepo.Save(suggestion);
     return(RedirectToAction("Index"));
 }