/// <summary> /// Function to retrieve persons party. /// </summary> /// <param name="persons">Instance of Persons</param> /// <param name="isFullStateroom">if set to <c>true</c> [is full stateroom].</param> /// <param name="isFromSearchFilter">if it is called from search filter.</param> /// <param name="searchType">Type of search</param> /// <returns>Instance of PersonsParty</returns> public async Task<PersonsParty> RetrieveParty(Person persons, bool isFullStateroom, bool isFromSearchFilter, SearchType searchType) { if (persons.CanCreateParty(searchType) && !isFromSearchFilter) { await this.CreateParty(persons, isFullStateroom); this.CurrentParty.IsPartyCreated = true; } else { this.CurrentParty = this.CurrentParty == null ? DIContainer.Instance.Resolve<PersonsParty>().AssignSearchedPersons(persons) : this.CurrentParty.AssignSearchedPersons(persons); this.CurrentParty.IsPartyCreated = false; DIContainer.Instance.Resolve<PhotoService>().RetrievePhotos(persons); } this.CurrentParty.IsAnyAdultAshore = false; this.CurrentParty.SearchType = searchType; return this.CurrentParty; }