| 123456789101112131415161718192021222324252627282930313233343536373839 |
- using System;
- namespace Quadarax.Foundation.Core.Data.Entity
- {
- public class NoKey : IEquatable<NoKey>
- {
- public Guid Hash { get; } = Guid.NewGuid();
- public bool Equals(NoKey? other)
- {
- if (other == null!)
- return false;
- return Hash == other.Hash;
- }
- public override bool Equals(object? obj)
- {
- if (ReferenceEquals(null, obj)) return false;
- if (ReferenceEquals(this, obj)) return true;
- if (obj.GetType() != this.GetType()) return false;
- return Equals((NoKey)obj);
- }
- public override int GetHashCode()
- {
- return Hash.GetHashCode();
- }
- public static bool operator ==(NoKey? left, NoKey right)
- {
- return Equals(left, right);
- }
- public static bool operator !=(NoKey left, NoKey right)
- {
- return !Equals(left, right);
- }
- }
- }
|