49 lines
1.4 KiB
C#
49 lines
1.4 KiB
C#
namespace NetinaShop.Common.Models.Entity;
|
|
public abstract class ApiEntity : IApiEntity , IEquatable<ApiEntity>
|
|
{
|
|
[Key]
|
|
public Guid Id { get; set; }
|
|
|
|
[Display(Name = "تاریخ حذف")]
|
|
public DateTime RemovedAt { get; set; }
|
|
|
|
[Display(Name = "تاریخ ساخت")]
|
|
public DateTime CreatedAt { get; set; }
|
|
|
|
[Display(Name = "ساخته شده توسط")]
|
|
public string CreatedBy { get; set; } = string.Empty;
|
|
|
|
[Display(Name = "حذف شده")]
|
|
public bool IsRemoved { get; set; }
|
|
[Display(Name = "حذف شده توسط")]
|
|
public string RemovedBy { get; set; } = string.Empty;
|
|
[Display(Name = "اخرین تغییر در")]
|
|
public DateTime ModifiedAt { get; set; }
|
|
|
|
[Display(Name = "اخرین تغییر توسط")]
|
|
public string ModifiedBy { get; set; } = string.Empty;
|
|
|
|
|
|
|
|
public bool Equals(ApiEntity? other)
|
|
{
|
|
if (ReferenceEquals(null, other)) return false;
|
|
if (ReferenceEquals(this, other)) return true;
|
|
return Id.Equals(other.Id);
|
|
}
|
|
|
|
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((ApiEntity)obj);
|
|
}
|
|
|
|
public override int GetHashCode()
|
|
{
|
|
return Id.GetHashCode();
|
|
}
|
|
|
|
}
|