C# Class Worki.Service.SearchService

Inheritance: ISearchService
Datei anzeigen Open project: tah91/eworkyWebSite

Public Methods

Method Description
FillResults ( SearchCriteriaFormViewModel criteriaViewModel ) : void

Fill search results from criteria 1 search matching localisations in repository 2 compute distance between place to search and search result for each result 3 push result in session

FillSearchResults ( SearchCriteria criteria ) : SearchCriteriaFormViewModel

get a SearchCriteriaFormViewModel containing the criteria and the results of a search if results in cache get it else build searchcriteria from url with this, search matchings localisations in repository fill the session store with computed results and returns the results

GetCriteria ( System.Web.HttpRequestBase parameters, int page = 1 ) : SearchCriteria

private method to create a SearchCriteria object from route data used to create search criteria from an url

GetRVD ( SearchCriteria criteria ) : RouteValueDictionary

private method to create route data from a SearchCriteria object used to pass search criteria in url

GetSingleResult ( System.Web.HttpRequestBase parameters, int index ) : SearchSingleResultViewModel

Get single result for a given index, within search results

SearchService ( ILogger logger, IGeocodeService geocodeService ) : System
ValidateLocalisation ( Localisation toValidate, string &error ) : void

Validate a localisation against database state, throws exception if not valide

Method Details

FillResults() public method

Fill search results from criteria 1 search matching localisations in repository 2 compute distance between place to search and search result for each result 3 push result in session
public FillResults ( SearchCriteriaFormViewModel criteriaViewModel ) : void
criteriaViewModel SearchCriteriaFormViewModel
return void

FillSearchResults() public method

get a SearchCriteriaFormViewModel containing the criteria and the results of a search if results in cache get it else build searchcriteria from url with this, search matchings localisations in repository fill the session store with computed results and returns the results
public FillSearchResults ( SearchCriteria criteria ) : SearchCriteriaFormViewModel
criteria SearchCriteria
return SearchCriteriaFormViewModel

GetCriteria() public method

private method to create a SearchCriteria object from route data used to create search criteria from an url
public GetCriteria ( System.Web.HttpRequestBase parameters, int page = 1 ) : SearchCriteria
parameters System.Web.HttpRequestBase
page int
return SearchCriteria

GetRVD() public method

private method to create route data from a SearchCriteria object used to pass search criteria in url
public GetRVD ( SearchCriteria criteria ) : RouteValueDictionary
criteria SearchCriteria
return RouteValueDictionary

GetSingleResult() public method

Get single result for a given index, within search results
public GetSingleResult ( System.Web.HttpRequestBase parameters, int index ) : SearchSingleResultViewModel
parameters System.Web.HttpRequestBase parameters from which to build result of not in session
index int index of the result item
return SearchSingleResultViewModel

SearchService() public method

public SearchService ( ILogger logger, IGeocodeService geocodeService ) : System
logger ILogger
geocodeService IGeocodeService
return System

ValidateLocalisation() public method

Validate a localisation against database state, throws exception if not valide
public ValidateLocalisation ( Localisation toValidate, string &error ) : void
toValidate Worki.Data.Models.Localisation localisation to validate
error string error to fill
return void