Merge pull request #234 from Joe4evr/IEquatable

Constrain IEntity's TId to IEquatable<TId>
This commit is contained in:
RogueException
2016-08-27 15:27:34 -03:00
committed by GitHub
2 changed files with 6 additions and 1 deletions

View File

@@ -1,6 +1,9 @@
using System;
namespace Discord namespace Discord
{ {
public interface IEntity<TId> public interface IEntity<TId>
where TId : IEquatable<TId>
{ {
/// <summary> Gets the unique identifier for this object. </summary> /// <summary> Gets the unique identifier for this object. </summary>
TId Id { get; } TId Id { get; }

View File

@@ -1,8 +1,10 @@
using Discord.Rest; using System;
using Discord.Rest;
namespace Discord.Rest namespace Discord.Rest
{ {
internal abstract class Entity<T> : IEntity<T> internal abstract class Entity<T> : IEntity<T>
where T : IEquatable<T>
{ {
public T Id { get; } public T Id { get; }