2
0

ItemListHandler.cs 804 B

1234567891011121314151617181920212223242526272829303132333435
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using MediaBrowser.Model.Entities;
  5. namespace MediaBrowser.Api.HttpHandlers
  6. {
  7. public abstract class ItemListHandler : JsonHandler
  8. {
  9. protected sealed override object ObjectToSerialize
  10. {
  11. get
  12. {
  13. return ItemsToSerialize.Select(i =>
  14. {
  15. return ApiService.GetSerializationObject(i, false, UserId);
  16. });
  17. }
  18. }
  19. protected abstract IEnumerable<BaseItem> ItemsToSerialize
  20. {
  21. get;
  22. }
  23. protected Guid UserId
  24. {
  25. get
  26. {
  27. return Guid.Parse(QueryString["userid"]);
  28. }
  29. }
  30. }
  31. }