コード例 #1
0
ファイル: ValueObject.cs プロジェクト: ssajous/DDDSample.Net
 /// <summary>
 /// Helper function for implementing overloaded equality operator.
 /// </summary>
 /// <param name="left">Left-hand side object.</param>
 /// <param name="right">Right-hand side object.</param>
 /// <returns></returns>
 protected static bool EqualOperator(ValueObject left, ValueObject right)
 {
    if (ReferenceEquals(left, null) ^ ReferenceEquals(right, null))
    {
       return false;
    }
    return ReferenceEquals(left, null) || left.Equals(right);
 }
コード例 #2
0
ファイル: ValueObject.cs プロジェクト: ssajous/DDDSample.Net
 /// <summary>
 /// Helper function for implementing overloaded inequality operator.
 /// </summary>
 /// <param name="left">Left-hand side object.</param>
 /// <param name="right">Right-hand side object.</param>
 /// <returns></returns>
 protected static bool NotEqualOperator(ValueObject left, ValueObject right)
 {
    return !EqualOperator(left,right);
 }