.NET Client Documentation
5.6.0
Search Results for

    Show / Hide Table of Contents

    PutAsync Method

    PutAsync(TKey, TValue)

    Sets (adds or updates) an entry, and returns the previous value, if any.

    Declaration
    Task<TValue> PutAsync(TKey key, TValue value)
    Parameters
    TKey key

    The key.

    TValue value

    The value.

    Returns
    Task<TValue>

    The previous value for the specified key, if any; otherwise default(TValue).

    PutAsync(TKey, TValue, TimeSpan)

    Sets (adds or updates) an entry with a time-to-live, and returns the previous value, if any.

    Declaration
    Task<TValue> PutAsync(TKey key, TValue value, TimeSpan timeToLive)
    Parameters
    TKey key

    The key.

    TValue value

    The value.

    TimeSpan timeToLive

    A time-to-live period.

    Returns
    Task<TValue>

    The previous value for the specified key, if any; otherwise default(TValue).

    Remarks

    The value is automatically expired, evicted and removed after the timeToLive has elapsed.

    TODO: document zero and infinite
    In this article
    Back to top Copyright © 2010-2024 Hazelcast, Inc. All rights reserved.
    Generated by DocFX.