-
Notifications
You must be signed in to change notification settings - Fork 3.4k
Expand file tree
/
Copy pathApiMember.cs
More file actions
32 lines (24 loc) · 991 Bytes
/
ApiMember.cs
File metadata and controls
32 lines (24 loc) · 991 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
using System;
using System.Text.Json.Serialization;
namespace ApiChief.Model;
public sealed class ApiMember : IEquatable<ApiMember>
{
[JsonPropertyOrder(0)]
public string Member { get; set; } = string.Empty;
[JsonPropertyOrder(1)]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingDefault)]
public ApiStage Stage { get; set; }
/// <summary>
/// Gets or sets a constant value (for constant field) to ensure it doesn't change between releases.
/// </summary>
[JsonPropertyOrder(2)]
public string? Value { get; set; }
public bool Equals(ApiMember? other)
=> other != null && Member == other.Member && Value == other.Value;
public override bool Equals(object? obj)
=> Equals(obj as ApiMember);
public override int GetHashCode()
=> HashCode.Combine(Member, Value);
}