Class HostDefinitionExtensions
Contains convenient extension methods for Host
Inheritance
System.Object
HostDefinitionExtensions
Namespace: EPiServer.Web
Assembly: EPiServer.dll
Version: 12.0.3Syntax
public static class HostDefinitionExtensions : Object
Methods
Find(IEnumerable<HostDefinition>, String, Boolean)
Finds a matching host
Declaration
public static HostDefinition Find(this IEnumerable<HostDefinition> hosts, string hostName, bool fallbackToWildcard)
Parameters
Type | Name | Description |
---|---|---|
System. |
hosts | The hosts to match against |
System. |
hostName | The hostname to match against |
System. |
fallbackToWildcard | Indicates if it should fallback to wildcard host '*' in case no match exist |
Returns
Type | Description |
---|---|
Host |
Matched host or null if no host matched |
FirstOfType(IEnumerable<HostDefinition>, HostDefinitionType)
Returns first host of specified type
Declaration
public static HostDefinition FirstOfType(this IEnumerable<HostDefinition> hosts, HostDefinitionType type)
Parameters
Type | Name | Description |
---|---|---|
System. |
hosts | The host to match against |
Host |
type | The type to match for |
Returns
Type | Description |
---|---|
Host |
First matched host or null if no host matched |
IsRedirect(HostDefinitionType)
Determines if specified host definition type is any redirect type
Declaration
public static bool IsRedirect(this HostDefinitionType type)
Parameters
Type | Name | Description |
---|---|---|
Host |
type | The type to determine |
Returns
Type | Description |
---|---|
System. |
true if type is considered being a redirect type else false |