1
0
mirror of https://github.com/akpaevj/onecmonitor.git synced 2026-06-17 22:34:48 +02:00
Files

28 lines
686 B
C#
Raw Permalink Normal View History

using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
2025-07-02 10:32:56 +03:00
namespace OneSwiss.Server.Models;
2025-07-06 01:36:48 +03:00
public abstract class DatabaseObject : IHasId
2025-07-02 10:32:56 +03:00
{
[DatabaseGenerated(DatabaseGeneratedOption.Identity)]
[Key]
2025-07-02 10:32:56 +03:00
public Guid Id { get; set; }
private bool Equals(DatabaseObject other)
{
return Id.Equals(other.Id);
}
public override bool Equals(object? obj)
{
if (obj is null) return false;
if (ReferenceEquals(this, obj)) return true;
return obj.GetType() == GetType() && Equals((DatabaseObject)obj);
}
public override int GetHashCode()
{
return Id.GetHashCode();
}
}