Person.cs 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. using System.Runtime.Serialization;
  2. using MediaBrowser.Model.Dto;
  3. using System;
  4. using System.Collections.Generic;
  5. namespace MediaBrowser.Controller.Entities
  6. {
  7. /// <summary>
  8. /// This is the full Person object that can be retrieved with all of it's data.
  9. /// </summary>
  10. public class Person : BaseItem, IItemByName
  11. {
  12. public Person()
  13. {
  14. UserItemCounts = new Dictionary<Guid, ItemByNameCounts>();
  15. }
  16. [IgnoreDataMember]
  17. public Dictionary<Guid, ItemByNameCounts> UserItemCounts { get; set; }
  18. /// <summary>
  19. /// Gets the user data key.
  20. /// </summary>
  21. /// <returns>System.String.</returns>
  22. public override string GetUserDataKey()
  23. {
  24. return "Person-" + Name;
  25. }
  26. }
  27. /// <summary>
  28. /// This is the small Person stub that is attached to BaseItems
  29. /// </summary>
  30. public class PersonInfo
  31. {
  32. /// <summary>
  33. /// Gets or sets the name.
  34. /// </summary>
  35. /// <value>The name.</value>
  36. public string Name { get; set; }
  37. /// <summary>
  38. /// Gets or sets the role.
  39. /// </summary>
  40. /// <value>The role.</value>
  41. public string Role { get; set; }
  42. /// <summary>
  43. /// Gets or sets the type.
  44. /// </summary>
  45. /// <value>The type.</value>
  46. public string Type { get; set; }
  47. /// <summary>
  48. /// Returns a <see cref="System.String" /> that represents this instance.
  49. /// </summary>
  50. /// <returns>A <see cref="System.String" /> that represents this instance.</returns>
  51. public override string ToString()
  52. {
  53. return Name;
  54. }
  55. }
  56. }