<PackageReference Include="System.ComponentModel.Annotations" Version="5.0.0-preview.2.20160.6" />

System.ComponentModel.DataAnnotations.CompareAttribute

Provides an attribute that compares two properties.
namespace System.ComponentModel.DataAnnotations { public class CompareAttribute : ValidationAttribute { public string OtherProperty { get; } public string OtherPropertyDisplayName { get; } public CompareAttribute(string otherProperty); } }