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

Anonymous
timer Asked: Jan 25th, 2014

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) Studypool Tutor
School: Rice University
Studypool has helped 1,244,100 students
flag Report DMCA
Similar Questions
Hot Questions
Related Tags

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