コード例 #1
0
 /// <summary>
 /// Initializes a new instance of the class and sets the values of its properties.
 /// </summary>
 /// <param name="destinationSystemEntityId">
 /// The ID that uniquely identifies the entity in the destination system.
 /// </param>
 /// <param name="weight">The weight of the duplicate.</param>
 public Duplicate(
     EntityIdentifier destinationSystemEntityId,
     MatchWeight weight)
 {
     ArgumentValidator.EnsureArgumentNotNull(
         destinationSystemEntityId, nameof(destinationSystemEntityId));
     this.ValidateWeight(weight);
     this.destinationSystemEntityId = destinationSystemEntityId;
     this.weight = weight;
 }
コード例 #2
0
        private void ValidateWeight(MatchWeight weight)
        {
            switch (weight)
            {
            case MatchWeight.Candidate:
            case MatchWeight.Positive:
            case MatchWeight.Inconsistent:
                break;

            default:
                throw new ArgumentException(string.Format(
                                                Resources.InvalidMatchWeight, weight),
                                            "weight");
            }
        }