Browse Source

To immutable list

pull/1604/head
Paulo 5 years ago
parent
commit
5228d8d7ea
2 changed files with 4 additions and 3 deletions
  1. +1
    -1
      src/Discord.Net.Core/Entities/Teams/ITeam.cs
  2. +3
    -2
      src/Discord.Net.Rest/Entities/Teams/RestTeam.cs

+ 1
- 1
src/Discord.Net.Core/Entities/Teams/ITeam.cs View File

@@ -18,7 +18,7 @@ namespace Discord
/// <summary> /// <summary>
/// Gets the members of this team. /// Gets the members of this team.
/// </summary> /// </summary>
List<ITeamMember> TeamMembers { get; }
IReadOnlyList<ITeamMember> TeamMembers { get; }
/// <summary> /// <summary>
/// Gets the user identifier that owns this team. /// Gets the user identifier that owns this team.
/// </summary> /// </summary>


+ 3
- 2
src/Discord.Net.Rest/Entities/Teams/RestTeam.cs View File

@@ -1,4 +1,5 @@
using System.Collections.Generic; using System.Collections.Generic;
using System.Collections.Immutable;
using System.Linq; using System.Linq;
using Model = Discord.API.Team; using Model = Discord.API.Team;


@@ -9,7 +10,7 @@ namespace Discord.Rest
/// <inheritdoc /> /// <inheritdoc />
public string IconUrl => _iconId != null ? CDN.GetTeamIconUrl(Id, _iconId) : null; public string IconUrl => _iconId != null ? CDN.GetTeamIconUrl(Id, _iconId) : null;
/// <inheritdoc /> /// <inheritdoc />
public List<ITeamMember> TeamMembers { get; private set; }
public IReadOnlyList<ITeamMember> TeamMembers { get; private set; }
/// <inheritdoc /> /// <inheritdoc />
public ulong OwnerUserId { get; private set; } public ulong OwnerUserId { get; private set; }


@@ -30,7 +31,7 @@ namespace Discord.Rest
if (model.Icon.IsSpecified) if (model.Icon.IsSpecified)
_iconId = model.Icon.Value; _iconId = model.Icon.Value;
OwnerUserId = model.OwnerUserId; OwnerUserId = model.OwnerUserId;
TeamMembers = model.TeamMembers.Select(x => new RestTeamMember(Discord, x)).ToList<ITeamMember>();
TeamMembers = model.TeamMembers.Select(x => new RestTeamMember(Discord, x)).ToImmutableList();
} }
} }
} }

Loading…
Cancel
Save