-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
77 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 4 additions & 1 deletion
5
src/Equatable.Generator/Attributes/HashSetEqualityAttribute.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,10 @@ | ||
using System.Diagnostics; | ||
using System.Diagnostics; | ||
|
||
namespace Equatable.Attributes; | ||
|
||
/// <summary> | ||
/// Use <see cref="ISet{T}.SetEquals(IEnumerable{T})"/> in Equals and GetHashCode implementations | ||
/// </summary> | ||
[Conditional("EQUATABLE_GENERATOR")] | ||
[AttributeUsage(AttributeTargets.Property | AttributeTargets.Field)] | ||
public class HashSetEqualityAttribute : Attribute; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,10 @@ | ||
using System.Diagnostics; | ||
using System.Diagnostics; | ||
|
||
namespace Equatable.Attributes; | ||
|
||
/// <summary> | ||
/// Ignore property in Equals and GetHashCode implementations | ||
/// </summary> | ||
[Conditional("EQUATABLE_GENERATOR")] | ||
[AttributeUsage(AttributeTargets.Property | AttributeTargets.Field)] | ||
public class IgnoreEqualityAttribute : Attribute; |
5 changes: 4 additions & 1 deletion
5
src/Equatable.Generator/Attributes/ReferenceEqualityAttribute.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,10 @@ | ||
using System.Diagnostics; | ||
using System.Diagnostics; | ||
|
||
namespace Equatable.Attributes; | ||
|
||
/// <summary> | ||
/// Use <see cref="Object.ReferenceEquals(object, object)"/> to determines whether instances are the same instance | ||
/// </summary> | ||
[Conditional("EQUATABLE_GENERATOR")] | ||
[AttributeUsage(AttributeTargets.Property | AttributeTargets.Field)] | ||
public class ReferenceEqualityAttribute : Attribute; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,17 @@ | ||
using System.Diagnostics; | ||
using System.Diagnostics; | ||
|
||
namespace Equatable.Attributes; | ||
|
||
/// <summary> | ||
/// Use specified <see cref="StringComparer" /> when comparing strings | ||
/// </summary> | ||
/// <param name="comparisonType">The <see cref="StringComparison"/> to use</param> | ||
[Conditional("EQUATABLE_GENERATOR")] | ||
[AttributeUsage(AttributeTargets.Property | AttributeTargets.Field)] | ||
public class StringEqualityAttribute(StringComparison comparisonType) : Attribute | ||
{ | ||
/// <summary> | ||
/// The <see cref="StringComparison"/> to use | ||
/// </summary> | ||
public StringComparison ComparisonType { get; } = comparisonType; | ||
} |