jellyfin-server/MediaBrowser.Controller/Persistence/IUserDataRepository.cs

50 lines
1.7 KiB
C#
Raw Normal View History

using System.Collections.Generic;
using MediaBrowser.Controller.Entities;
2013-09-30 22:18:44 +00:00
using System;
2013-02-21 01:33:05 +00:00
using System.Threading;
using System.Threading.Tasks;
namespace MediaBrowser.Controller.Persistence
{
/// <summary>
/// Provides an interface to implement a UserData repository
/// </summary>
public interface IUserDataRepository : IRepository
{
/// <summary>
/// Saves the user data.
2013-02-21 01:33:05 +00:00
/// </summary>
/// <param name="userId">The user id.</param>
/// <param name="key">The key.</param>
/// <param name="userData">The user data.</param>
2013-02-21 01:33:05 +00:00
/// <param name="cancellationToken">The cancellation token.</param>
/// <returns>Task.</returns>
2013-10-02 16:08:58 +00:00
Task SaveUserData(Guid userId, string key, UserItemData userData, CancellationToken cancellationToken);
2013-02-21 01:33:05 +00:00
/// <summary>
/// Gets the user data.
2013-02-21 01:33:05 +00:00
/// </summary>
/// <param name="userId">The user id.</param>
/// <param name="key">The key.</param>
/// <returns>Task{UserItemData}.</returns>
2013-06-17 20:35:43 +00:00
UserItemData GetUserData(Guid userId, string key);
/// <summary>
/// Return all user data associated with the given user
/// </summary>
/// <param name="userId"></param>
/// <returns></returns>
IEnumerable<UserItemData> GetAllUserData(Guid userId);
/// <summary>
/// Save all user data associated with the given user
/// </summary>
/// <param name="userId"></param>
/// <param name="userData"></param>
/// <param name="cancellationToken"></param>
/// <returns></returns>
Task SaveAllUserData(Guid userId, IEnumerable<UserItemData> userData, CancellationToken cancellationToken);
2013-02-21 01:33:05 +00:00
}
}