Class DatabaseVersionValidator
Validates the database version against the supported assembly version.
Inheritance
System.Object
DatabaseVersionValidator
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.Data
Assembly: EPiServer.Data.dll
Version: 7.19.2Syntax
public class DatabaseVersionValidator
Constructors
DatabaseVersionValidator(IDatabaseHandler)
Initializes a new instance of the DatabaseVersionValidator class.
Declaration
public DatabaseVersionValidator(IDatabaseHandler databaseHandler)
Parameters
Type | Name | Description |
---|---|---|
IDatabaseHandler | databaseHandler | The database handler. |
Methods
GetDatabaseVersion()
Gets the database version.
Declaration
public virtual Version GetDatabaseVersion()
Returns
Type | Description |
---|---|
System.Version |
ThrowUpdateCodeException(Version, Version)
Throws an NotSupportedException exception saying that packages needs to be updated.
Declaration
public virtual void ThrowUpdateCodeException(Version databaseVersion, Version codeVersion)
Parameters
Type | Name | Description |
---|---|---|
System.Version | databaseVersion | The database version |
System.Version | codeVersion | The .NET code version |
ThrowUpdateDatabaseException(Version, Version)
Throws an NotSupportedException exception saying that database needs to be updated.
Declaration
public virtual void ThrowUpdateDatabaseException(Version databaseVersion, Version codeVersion)
Parameters
Type | Name | Description |
---|---|---|
System.Version | databaseVersion | The database version |
System.Version | codeVersion | The .NET code version |
ValidateDatabaseVersion(Version)
Validates the database version.
Declaration
public virtual void ValidateDatabaseVersion(Version supportedVersion)
Parameters
Type | Name | Description |
---|---|---|
System.Version | supportedVersion |
Exceptions
Type | Condition |
---|---|
System.NotSupportedException | Will be thrown if the database version not maches the supported version. |