Person.cs 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  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. ItemCounts = new ItemByNameCounts();
  15. UserItemCounts = new Dictionary<Guid, ItemByNameCounts>();
  16. }
  17. [IgnoreDataMember]
  18. public ItemByNameCounts ItemCounts { get; set; }
  19. [IgnoreDataMember]
  20. public Dictionary<Guid, ItemByNameCounts> UserItemCounts { get; set; }
  21. /// <summary>
  22. /// Gets the user data key.
  23. /// </summary>
  24. /// <returns>System.String.</returns>
  25. public override string GetUserDataKey()
  26. {
  27. return "Person-" + Name;
  28. }
  29. }
  30. /// <summary>
  31. /// This is the small Person stub that is attached to BaseItems
  32. /// </summary>
  33. public class PersonInfo
  34. {
  35. /// <summary>
  36. /// Gets or sets the name.
  37. /// </summary>
  38. /// <value>The name.</value>
  39. public string Name { get; set; }
  40. /// <summary>
  41. /// Gets or sets the role.
  42. /// </summary>
  43. /// <value>The role.</value>
  44. public string Role { get; set; }
  45. /// <summary>
  46. /// Gets or sets the type.
  47. /// </summary>
  48. /// <value>The type.</value>
  49. public string Type { get; set; }
  50. /// <summary>
  51. /// Returns a <see cref="System.String" /> that represents this instance.
  52. /// </summary>
  53. /// <returns>A <see cref="System.String" /> that represents this instance.</returns>
  54. public override string ToString()
  55. {
  56. return Name;
  57. }
  58. }
  59. }