Show / Hide Table of Contents

    Class CacheProperty

    Represents a cache property that needs to be set, replaced, or removed for the current service.

    Inheritance
    Object
    CacheProperty
    Implements
    IValidator
    IEquatable<CacheProperty>
    Inherited Members
    Object.Equals(Object, Object)
    Object.ReferenceEquals(Object, Object)
    Object.GetType()
    Object.MemberwiseClone()
    Namespace: Nevatech.Vsb.Repository.Processing
    Assembly: Nevatech.Vsb.Repository.dll
    Syntax
    public sealed class CacheProperty : IValidator, IEquatable<CacheProperty>

    Constructors

    CacheProperty()

    Declaration
    public CacheProperty()

    Fields

    CachePropertyNameFormat

    Regular expression used for validating a cache property name.

    Declaration
    public static readonly Regex CachePropertyNameFormat
    Field Value
    Type Description
    Regex

    ElementName

    Name of the root element when object is serialized to XML.

    Declaration
    public const string ElementName = "PROPERTY"
    Field Value
    Type Description
    String

    Properties

    CacheSeconds

    Gets or sets the number of seconds to keep the value in cache.

    Declaration
    public string CacheSeconds { get; set; }
    Property Value
    Type Description
    String

    ErrorMessage

    Gets the summary of validation errors populated by the call to Validate() method.

    Declaration
    public string ErrorMessage { get; }
    Property Value
    Type Description
    String

    KeepExpirationIfExists

    Gets or sets the flag indicating that property expiration must not be extended (reset), if property already exists in the cache. Default is false.

    Declaration
    public bool KeepExpirationIfExists { get; set; }
    Property Value
    Type Description
    Boolean

    Name

    Gets or sets the property name.

    Declaration
    public string Name { get; set; }
    Property Value
    Type Description
    String

    Value

    Gets or sets the static property value. If set to Null then existing property will be deleted.

    Declaration
    public string Value { get; set; }
    Property Value
    Type Description
    String

    Methods

    Equals(CacheProperty)

    Determines whether the specified object is equal to the current object.

    Declaration
    public bool Equals(CacheProperty other)
    Parameters
    Type Name Description
    CacheProperty other

    The object to compare with the current object.

    Returns
    Type Description
    Boolean

    True, if objects are equal. False, if objects are not equal.

    Equals(Object)

    Determines whether the specified object is equal to the current object.

    Declaration
    public override bool Equals(object obj)
    Parameters
    Type Name Description
    Object obj

    The object to compare with the current object.

    Returns
    Type Description
    Boolean

    True, if objects are equal. False, if objects are not equal.

    Overrides
    Object.Equals(Object)

    Get(Guid, String, Boolean)

    Retrieves the value of the specified property from the cache.

    Declaration
    public static string Get(Guid serviceVersionKey, string propertyName, bool updateExpiry = false)
    Parameters
    Type Name Description
    Guid serviceVersionKey

    Key of the service version this property belongs to.

    String propertyName

    Property name.

    Boolean updateExpiry

    True to update existing key expiry to a new value (sliding expiration). The default value is false.

    Returns
    Type Description
    String

    Property value.

    GetHashCode()

    Returns the hash code for this instance.

    Declaration
    public override int GetHashCode()
    Returns
    Type Description
    Int32

    Hash code of the current instance.

    Overrides
    Object.GetHashCode()

    Remove(Guid, String)

    Removes the specified property from the cache.

    Declaration
    public static void Remove(Guid serviceVersionKey, string propertyName)
    Parameters
    Type Name Description
    Guid serviceVersionKey

    Key of the service version this property belongs to.

    String propertyName

    Property name.

    Set(Guid, String, String, Nullable<TimeSpan>, Boolean)

    Stores the provided property value in the cache.

    Declaration
    public static void Set(Guid serviceVersionKey, string propertyName, string propertyValue, TimeSpan? duration, bool updateExpiry = true)
    Parameters
    Type Name Description
    Guid serviceVersionKey

    Key of the service version this property belongs to.

    String propertyName

    Property name.

    String propertyValue

    Property value.

    Nullable<TimeSpan> duration

    After the timeout has expired, the property will automatically be deleted. Setting this value to null will remove the timeout (make property persistent).

    Boolean updateExpiry

    True to update existing key expiry to a new value (reset expiration). The default value is true.

    ToString()

    Returns string representation of the object.

    Declaration
    public override string ToString()
    Returns
    Type Description
    String

    String representing the object's content.

    Overrides
    Object.ToString()

    Validate()

    Evaluates the state of this object.

    Declaration
    public bool Validate()
    Returns
    Type Description
    Boolean

    True if state is valid; otherwise, false.

    Implements

    IValidator
    System.IEquatable<T>
    Back to top Nevatech Sentinet 6.5 Online Documentation