Search Results for

    Show / Hide Table of Contents
    View Source

    Interface IKeyValueService

    Manages the simplified key/value store.

    Namespace: Umbraco.Cms.Core.Services
    Assembly: Umbraco.Core.dll
    Syntax
    public interface IKeyValueService

    Methods

    View Source

    FindByKeyPrefix(String)

    Returns key/value pairs for all keys with the specified prefix.

    Declaration
    IReadOnlyDictionary<string, string>? FindByKeyPrefix(string keyPrefix)
    Parameters
    Type Name Description
    System.String keyPrefix
    Returns
    Type Description
    System.Nullable<IReadOnlyDictionary<System.String, System.String>>
    View Source

    GetValue(String)

    Gets a value.

    Declaration
    string GetValue(string key)
    Parameters
    Type Name Description
    System.String key
    Returns
    Type Description
    System.String
    Remarks

    Returns null if no value was found for the key.

    View Source

    SetValue(String, String)

    Sets a value.

    Declaration
    void SetValue(string key, string value)
    Parameters
    Type Name Description
    System.String key
    System.String value
    View Source

    SetValue(String, String, String)

    Sets a value.

    Declaration
    void SetValue(string key, string originValue, string newValue)
    Parameters
    Type Name Description
    System.String key
    System.String originValue
    System.String newValue
    Remarks

    Sets the value to newValue if the value is originValue, and returns true; otherwise throws an exception. In other words, ensures that the value has not changed before setting it.

    View Source

    TrySetValue(String, String, String)

    Tries to set a value.

    Declaration
    bool TrySetValue(string key, string originValue, string newValue)
    Parameters
    Type Name Description
    System.String key
    System.String originValue
    System.String newValue
    Returns
    Type Description
    System.Boolean
    Remarks

    Sets the value to newValue if the value is originValue, and returns true; otherwise returns false. In other words, ensures that the value has not changed before setting it.

    • Improve this Doc
    • View Source
    In This Article
    • Methods
      • FindByKeyPrefix(String)
      • GetValue(String)
      • SetValue(String, String)
      • SetValue(String, String, String)
      • TrySetValue(String, String, String)
    Back to top Copyright © 2016-present Umbraco
    Generated by DocFX