using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; using Transactional.Abstractions; namespace back.DataModels; [Table("Galleries")] public partial class Gallery: IEquatable, ISoftDeletable { [Key, DatabaseGenerated(DatabaseGeneratedOption.Identity)] public string Id { get; set; } = null!; [MaxLength(100)] public string? Title { get; set; } [MaxLength(500)] public string? Description { get; set; } public string? CreatedAt { get; set; } public string? UpdatedAt { get; set; } public string CreatedBy { get; set; } = null!; public int? IsPublic { get; set; } public int? IsArchived { get; set; } public int? IsFavorite { get; set; } public int IsDeleted { get; set; } public string? DeletedAt { get; set; } public string? EventId { get; set; } public virtual User CreatedByNavigation { get; set; } = null!; public virtual Event? Event { get; set; } public virtual ICollection Photos { get; set; } = []; public virtual ICollection Tags { get; set; } = []; public virtual ICollection Users { get; set; } = []; public Gallery() { } public override int GetHashCode() => HashCode.Combine(Id, Title); public override bool Equals(object? obj) => obj is Gallery otherEvent && Equals(otherEvent); public bool Equals(Gallery? other) { if (other is null) return false; if (ReferenceEquals(this, other)) return true; return Id == other.Id || GetHashCode() == other.GetHashCode(); } }