healthchecks
This commit is contained in:
@@ -1,11 +1,12 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
using Transactional.Abstractions;
|
||||
using Transactional.Abstractions.Interfaces;
|
||||
|
||||
namespace back.DataModels;
|
||||
|
||||
[Table("Persons")]
|
||||
public partial class Person: IEquatable<Person>, ISoftDeletable
|
||||
public partial class Person: IEntity<Person>, ISoftDeletable
|
||||
{
|
||||
[Key, DatabaseGenerated(DatabaseGeneratedOption.Identity)]
|
||||
public string Id { get; set; } = null!;
|
||||
@@ -26,6 +27,7 @@ public partial class Person: IEquatable<Person>, ISoftDeletable
|
||||
public virtual User? User { get; set; }
|
||||
public virtual ICollection<Photo> PhotosNavigation { get; set; } = [];
|
||||
|
||||
|
||||
public override int GetHashCode() => HashCode.Combine(Id, Name);
|
||||
|
||||
public override bool Equals(object? obj)
|
||||
@@ -38,6 +40,23 @@ public partial class Person: IEquatable<Person>, ISoftDeletable
|
||||
return
|
||||
Id == other.Id || GetHashCode() == other.GetHashCode();
|
||||
}
|
||||
public bool IsNull => this is null;
|
||||
|
||||
public object Clone() => (Person)MemberwiseClone();
|
||||
|
||||
public int CompareTo(object? obj)
|
||||
{
|
||||
if(obj is null) return 1;
|
||||
if (obj is not Person other) throw new ArgumentException("Object is not a Person");
|
||||
return CompareTo(other);
|
||||
}
|
||||
|
||||
public int CompareTo(Person? other)
|
||||
{
|
||||
if (other is null) return 1;
|
||||
if (ReferenceEquals(this, other)) return 0;
|
||||
return string.Compare(Id, other.Id, StringComparison.OrdinalIgnoreCase);
|
||||
}
|
||||
|
||||
public const string SystemPersonId = "00000000-0000-0000-0000-000000000001";
|
||||
|
||||
|
Reference in New Issue
Block a user