Class HostDefinitionExtensions
Contains convenient extension methods for HostDefinitionType
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.Collections.Generic.IEnumerable<HostDefinition> | hosts | The hosts to match against |
System.String | hostName | The hostname to match against |
System.Boolean | fallbackToWildcard | Indicates if it should fallback to wildcard host '*' in case no match exist |
Returns
Type | Description |
---|---|
HostDefinition | 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.Collections.Generic.IEnumerable<HostDefinition> | hosts | The host to match against |
HostDefinitionType | type | The type to match for |
Returns
Type | Description |
---|---|
HostDefinition | 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 |
---|---|---|
HostDefinitionType | type | The type to determine |
Returns
Type | Description |
---|---|
System.Boolean | true if type is considered being a redirect type else false |