namespace Dto; public class SuccessDto : IEquatable { public int UserId { get; set; } public int InquiryId { get; set; } public bool IsFinished { get; set; } public SuccessDto() { } public SuccessDto(int userId, int inquiryId, bool isFinished) { UserId = userId; InquiryId = inquiryId; IsFinished = isFinished; } public override string ToString() { return $"User :{UserId}\t Enquête : {InquiryId}\t{IsFinished}"; } public override bool Equals(object right) { if (object.ReferenceEquals(right, null)) { return false; } if (object.ReferenceEquals(this, right)) { return true; } if (this.GetType() != right.GetType()) { return false; } return this.Equals(right as SuccessDto); } public bool Equals(SuccessDto other) { return (this.UserId == other.UserId && this.InquiryId == other.InquiryId); } public override int GetHashCode() { return UserId * InquiryId; } }