Files
mmorales.photo/back/DataModels/Gallery.cs
2025-08-28 16:01:55 +02:00

45 lines
1.6 KiB
C#

using MCVIngenieros.Transactional.Abstractions;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
namespace back.DataModels;
[Table("Galleries")]
public partial class Gallery: IEquatable<Gallery>, 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<Photo> Photos { get; set; } = [];
public virtual ICollection<Tag> Tags { get; set; } = [];
public virtual ICollection<User> 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();
}
}