What is the difference between these two Demand Controller "Actions"?

SoccerBoss
Category:
Programming
Price: $30 USD

Question description

Could somebody tell what the difference is between these two "Actions"? It would help me further understand the rest of the application I am looking at.

  /// <summary>
  /// Gets the person search page.
  /// </summary>
  /// <returns>
  /// The person search page.
  /// </returns>
  /// GET: /Person/Search
  [HttpGet]
  public ActionResult Search()
  {
  return
  this.View(
  new PersonSearchViewModel
  {
CountryViewModel =
  new CountryViewModel
  {
Country =
  new SelectList(this.countryManager.GetCountries(), "Name"),
 Cities = new SelectList(new List<City>(), "Name")
  }
  });
  }

  /// <summary>
  /// Searches the person.
  /// </summary>
  /// <param name="viewModel">
  /// The <see cref="PersonSearchViewModel"/> to filter by.
  /// </param>
  /// <returns>
  /// The <see cref="ActionResult"/>.
  /// </returns>
  /// POST: /Person/Search
  [HttpPost]
  public ActionResult Search(PersonSearchViewModel viewModel)
  {
  viewModel.CountryViewModel = new CountryViewModel
  {
 Countries = new SelectList(this.countryManager.GetPCountries(), "Id", "Name"),
 Cities =
  viewModel.SearchCriteria.CountryId > 0
  ? new SelectList(
  this.countryManager.GetCitiesviewModel.SearchCriteria.CountryId.GetValueOrDefault()),
  "Id",
  "Name")
  : new SelectList(new List<City>(), "Id", "Name")
  };


  viewModel.PersonViewModel = new PersonViewModel
  {
  People = new SelectList(this.personManager.GetAllPeople)),
  };


  if (!this.ModelState.IsValid)
  {
  return this.View(viewModel);
  }

  viewModel.SearchResult = this.peopleManager.FindPeople(viewModel.SearchCriteria, 1234);

  return this.View(viewModel);


  }

Tutor Answer

(Top Tutor) Daniel C.
(997)
School: Carnegie Mellon University
PREMIUM TUTOR
Studypool has helped 1,244,100 students
Ask your homework questions. Receive quality answers!

Type your question here (or upload an image)

1822 tutors are online

Brown University





1271 Tutors

California Institute of Technology




2131 Tutors

Carnegie Mellon University




982 Tutors

Columbia University





1256 Tutors

Dartmouth University





2113 Tutors

Emory University





2279 Tutors

Harvard University





599 Tutors

Massachusetts Institute of Technology



2319 Tutors

New York University





1645 Tutors

Notre Dam University





1911 Tutors

Oklahoma University





2122 Tutors

Pennsylvania State University





932 Tutors

Princeton University





1211 Tutors

Stanford University





983 Tutors

University of California





1282 Tutors

Oxford University





123 Tutors

Yale University





2325 Tutors