Class SiteDefinitionRepository
The repository that handles loading and persisting of sites, see SiteDefinition.
Inheritance
System.Object
SiteDefinitionRepository
Inherited Members
System.Object.ToString()
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
Namespace: EPiServer.Web
Assembly: EPiServer.dll
Version: 9.12.2Syntax
[ServiceConfiguration(typeof(SiteDefinitionRepository), Lifecycle = ServiceInstanceScope.Singleton)]
public class SiteDefinitionRepository
Constructors
SiteDefinitionRepository(DynamicDataStoreFactory, ISynchronizedObjectInstanceCache)
Declaration
[Obsolete("Use alternative constructor")]
public SiteDefinitionRepository(DynamicDataStoreFactory storeFactory, ISynchronizedObjectInstanceCache cache)
Parameters
Type | Name | Description |
---|---|---|
DynamicDataStoreFactory | storeFactory | |
ISynchronizedObjectInstanceCache | cache |
SiteDefinitionRepository(SiteDefinitionDB, ISynchronizedObjectInstanceCache)
Initializes a new instance of the SiteDefinitionRepository class.
Declaration
[Obsolete("Use alternative constructor")]
public SiteDefinitionRepository(SiteDefinitionDB dataAccess, ISynchronizedObjectInstanceCache cache)
Parameters
Type | Name | Description |
---|---|---|
SiteDefinitionDB | dataAccess | |
ISynchronizedObjectInstanceCache | cache |
SiteDefinitionRepository(SiteDefinitionDB, ISynchronizedObjectInstanceCache, IEventRegistry)
Initializes a new instance of the SiteDefinitionRepository class.
Declaration
public SiteDefinitionRepository(SiteDefinitionDB dataAccess, ISynchronizedObjectInstanceCache cache, IEventRegistry eventRegistry)
Parameters
Type | Name | Description |
---|---|---|
SiteDefinitionDB | dataAccess | |
ISynchronizedObjectInstanceCache | cache | |
IEventRegistry | eventRegistry |
Methods
Delete(Guid)
Deletes the SiteDefinition with specified id.
Declaration
public virtual void Delete(Guid id)
Parameters
Type | Name | Description |
---|---|---|
System.Guid | id | The id. |
Get(Guid)
Gets the SiteDefinition with specified id.
Declaration
public virtual SiteDefinition Get(Guid id)
Parameters
Type | Name | Description |
---|---|---|
System.Guid | id | The id. |
Returns
Type | Description |
---|---|
SiteDefinition |
Get(String)
Gets the SiteDefinition with specified name.
Declaration
public virtual SiteDefinition Get(string name)
Parameters
Type | Name | Description |
---|---|---|
System.String | name | The name. |
Returns
Type | Description |
---|---|
SiteDefinition |
Get(HttpRequestBase)
Gets the SiteDefinition that has a host that matches specified request.
Declaration
[Obsolete("Use SiteDefinitionResolver.GetByHostName for equivalent functionality")]
public virtual SiteDefinition Get(HttpRequestBase request)
Parameters
Type | Name | Description |
---|---|---|
System.Web.HttpRequestBase | request | The request. |
Returns
Type | Description |
---|---|
SiteDefinition |
GetHostName(HttpRequestBase)
Gets the name of the host from the request
Declaration
[Obsolete("Use HttpRequestBase extension method HostName instead.")]
public virtual string GetHostName(HttpRequestBase request)
Parameters
Type | Name | Description |
---|---|---|
System.Web.HttpRequestBase | request | The request. |
Returns
Type | Description |
---|---|
System.String |
List()
Lists all defined SiteDefinition.
Declaration
public virtual IEnumerable<SiteDefinition> List()
Returns
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<SiteDefinition> |
Exceptions
Type | Condition |
---|---|
System.NotImplementedException |
OnSiteDefinitionChanged()
Called when site definition changed.
Declaration
protected virtual void OnSiteDefinitionChanged()
Save(SiteDefinition)
Saves the specified site definition.
Declaration
public virtual void Save(SiteDefinition siteDefinition)
Parameters
Type | Name | Description |
---|---|---|
SiteDefinition | siteDefinition | The site definition. |
Events
SiteDefinitionChanged
Occurs when some SiteDefinition was changed or deleted.
Declaration
public event EventHandler<EventArgs> SiteDefinitionChanged
Event Type
Type | Description |
---|---|
System.EventHandler<System.EventArgs> |