Answers for "listaddtoleftasync example c#"

C#
0

listaddtoleftasync example c#

public async Task<long> ListAddToLeftAsync<T>(string key, T item) where T : class
        {
            if (string.IsNullOrEmpty(key))
            {
                throw new ArgumentException("key cannot be empty.", nameof(key));
            }
 
            if (item == null)
            {
                throw new ArgumentNullException(nameof(item), "item cannot be null.");
            }
 
            var serializedItem = await Serializer.SerializeAsync(item);
 
            return await Database.ListLeftPushAsync(key, serializedItem);
        }
Posted by: Guest on January-12-2021

C# Answers by Framework

Browse Popular Code Answers by Language