Class SiteDefinitionResolverExtensions
Extends ISiteDefinitionResolver with convenient methods
Inheritance
Inherited Members
Namespace: EPiServer.Web
Assembly: EPiServer.dll
Version: 10.10.4Syntax
public static class SiteDefinitionResolverExtensionsMethods
Get(ISiteDefinitionResolver, HttpRequestBase)
Gets the SiteDefinition that has a host that matches specified request.
Declaration
public static SiteDefinition Get(this ISiteDefinitionResolver siteDefinitionResolver, HttpRequestBase request)Parameters
| Type | Name | Description | 
|---|---|---|
| ISiteDefinitionResolver | siteDefinitionResolver | The site definition resolver that is being extended | 
| System.Web.HttpRequestBase | request | The request. | 
Returns
| Type | Description | 
|---|---|
| SiteDefinition | 
GetByContent(ISiteDefinitionResolver, ContentReference, Boolean, Boolean)
Gets the SiteDefinition for a content reference.
Declaration
public static SiteDefinition GetByContent(this ISiteDefinitionResolver siteDefinitionResolver, ContentReference contentLink, bool fallbackToWildcard, bool fallbackToEmpty)Parameters
| Type | Name | Description | 
|---|---|---|
| ISiteDefinitionResolver | siteDefinitionResolver | The site definition resolver that is being extended | 
| ContentReference | contentLink | The content link. | 
| System.Boolean | fallbackToWildcard | if set to  | 
| System.Boolean | fallbackToEmpty | if set to  | 
Returns
| Type | Description | 
|---|---|
| SiteDefinition | A SiteDefinition instance for the site that  | 
Remarks
This is done by traversing the page tree upwards from current link until a Page that matches a StartPage for a registered SiteDefinition.
    If the contentLink is not located beneath a start page, the search will fall back to the SiteDefinition instance
    for the site mapped with * as host fallbackToWildcard is set to True. If the contentLink is not located beneath a start page,
    and if not fallen back to wildcard and fallbackToEmpty is set to true then the system default setting will be returned which
    has for example RootPage set but not site specific settings like StartPage and SiteUrl.
GetByHostname(ISiteDefinitionResolver, String, Boolean)
Gets the SiteDefinition that has a host that matches specified hostname.
Declaration
public static SiteDefinition GetByHostname(this ISiteDefinitionResolver siteDefinitionResolver, string hostname, bool fallbackToWildcard)Parameters
| Type | Name | Description | 
|---|---|---|
| ISiteDefinitionResolver | siteDefinitionResolver | The site definition resolver that is being extended | 
| System.String | hostname | Name of the host. | 
| System.Boolean | fallbackToWildcard | if set to  | 
Returns
| Type | Description | 
|---|---|
| SiteDefinition | 
