IItemRepository.cs 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. using MediaBrowser.Controller.Entities;
  2. using System;
  3. using System.Collections.Generic;
  4. using System.Threading;
  5. using System.Threading.Tasks;
  6. namespace MediaBrowser.Controller.Persistence
  7. {
  8. /// <summary>
  9. /// Provides an interface to implement an Item repository
  10. /// </summary>
  11. public interface IItemRepository : IRepository
  12. {
  13. /// <summary>
  14. /// Saves an item
  15. /// </summary>
  16. /// <param name="item">The item.</param>
  17. /// <param name="cancellationToken">The cancellation token.</param>
  18. /// <returns>Task.</returns>
  19. Task SaveItem(BaseItem item, CancellationToken cancellationToken);
  20. /// <summary>
  21. /// Gets an item
  22. /// </summary>
  23. /// <param name="id">The id.</param>
  24. /// <returns>BaseItem.</returns>
  25. BaseItem GetItem(Guid id);
  26. /// <summary>
  27. /// Gets children of a given Folder
  28. /// </summary>
  29. /// <param name="parent">The parent.</param>
  30. /// <returns>IEnumerable{BaseItem}.</returns>
  31. IEnumerable<BaseItem> RetrieveChildren(Folder parent);
  32. /// <summary>
  33. /// Retrieves the items.
  34. /// </summary>
  35. /// <param name="ids">The ids.</param>
  36. /// <returns>IEnumerable{BaseItem}.</returns>
  37. IEnumerable<BaseItem> GetItems(IEnumerable<Guid> ids);
  38. /// <summary>
  39. /// Saves children of a given Folder
  40. /// </summary>
  41. /// <param name="parentId">The parent id.</param>
  42. /// <param name="children">The children.</param>
  43. /// <param name="cancellationToken">The cancellation token.</param>
  44. /// <returns>Task.</returns>
  45. Task SaveChildren(Guid parentId, IEnumerable<BaseItem> children, CancellationToken cancellationToken);
  46. }
  47. }