back photo + event tags and persons
This commit is contained in:
68
back/DataModels/PhotoModel.cs
Normal file
68
back/DataModels/PhotoModel.cs
Normal file
@@ -0,0 +1,68 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
|
||||
namespace back.DataModels;
|
||||
|
||||
[Table("Photo")]
|
||||
public class PhotoModel
|
||||
{
|
||||
[Key]
|
||||
public string Id { get; set; }
|
||||
[Required, MaxLength(100), MinLength(1)]
|
||||
public string Title { get; set; }
|
||||
[MaxLength(500)]
|
||||
public string Description { get; set; }
|
||||
public string Extension { get; set; }
|
||||
public string LowResUrl { get; set; }
|
||||
public string MidResUrl { get; set; }
|
||||
public string HighResUrl { get; set; }
|
||||
public DateTime CreatedAt { get; set; }
|
||||
public DateTime UpdatedAt { get; set; }
|
||||
public string CreatedBy { get; set; }
|
||||
public string UpdatedBy { get; set; }
|
||||
public EventModel? Event { get; set; } = null;
|
||||
public List<TagModel> Tags { get; set; } = [];
|
||||
public RankingModel Ranking { get; set; } = new RankingModel(0);
|
||||
public bool IsFavorite { get; set; } = false;
|
||||
public bool IsPublic { get; set; } = true;
|
||||
public bool IsArchived { get; set; } = false;
|
||||
public List<PersonModel>? Persons { get; set; }
|
||||
|
||||
public PhotoModel(
|
||||
string id,
|
||||
string title,
|
||||
string description,
|
||||
string lowResUrl,
|
||||
string midResUrl,
|
||||
string highResUrl,
|
||||
DateTime createdAt,
|
||||
DateTime updatedAt,
|
||||
string createdBy,
|
||||
string updatedBy,
|
||||
EventModel? @event = null,
|
||||
List<TagModel>? tags = null,
|
||||
RankingModel? ranking = null,
|
||||
bool isFavorite = false,
|
||||
bool isPublic = true,
|
||||
bool isArchived = false,
|
||||
List<PersonModel>? persons = null)
|
||||
{
|
||||
Id = id;
|
||||
Title = title;
|
||||
Description = description;
|
||||
LowResUrl = lowResUrl;
|
||||
MidResUrl = midResUrl;
|
||||
HighResUrl = highResUrl;
|
||||
CreatedAt = createdAt;
|
||||
UpdatedAt = updatedAt;
|
||||
CreatedBy = createdBy;
|
||||
UpdatedBy = updatedBy;
|
||||
Event = @event ?? Event;
|
||||
Tags = tags ?? Tags;
|
||||
Ranking = ranking ?? Ranking;
|
||||
IsFavorite = isFavorite;
|
||||
IsPublic = isPublic;
|
||||
IsArchived = isArchived;
|
||||
Persons = persons ?? Persons;
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user