public IActionResult OnPostOk()
 {
     if (ModelState.IsValid)
     {
         if (Excursion.ToursId == null)
         {
             Excursion.ToursId = new List <string>();
         }
         Excursion.Id = ObjectId.GenerateNewId().ToString();
         _tourList.SynchronizeAdding(Excursion);
         _excursionList.Add(Excursion);
         return(RedirectToPage("Excursions", new { userId = UserId }));
     }
     return(Page());
 }
Esempio n. 2
0
 public IActionResult OnPostOk()
 {
     if (ModelState.IsValid)
     {
         if (Agency.ToursId == null)
         {
             Agency.ToursId = new List <string>();
         }
         Agency.Id = ObjectId.GenerateNewId().ToString();
         _tourList.SynchronizeAdding(Agency);
         _agencyList.Add(Agency);
         return(RedirectToPage("TravelAgencies", new { userId = UserId }));
     }
     return(Page());
 }