back photo + event tags and persons
This commit is contained in:
52
back/DataModels/EventModel.cs
Normal file
52
back/DataModels/EventModel.cs
Normal file
@@ -0,0 +1,52 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
|
||||
namespace back.DataModels;
|
||||
|
||||
[Table("Events")]
|
||||
public class EventModel
|
||||
{
|
||||
[Key]
|
||||
public string Id { get; set; }
|
||||
[Required, MaxLength(50)]
|
||||
public string? Title { get; set; }
|
||||
[MaxLength(500)]
|
||||
public string? Description { get; set; }
|
||||
public DateTime? Date { get; set; }
|
||||
public string? Location { get; set; }
|
||||
public List<TagModel> RelatedTags { get; set; } = [];
|
||||
public DateTime CreatedAt { get; set; }
|
||||
public DateTime UpdatedAt { get; set; }
|
||||
public string? CreatedBy { get; set; }
|
||||
public string? UpdatedBy { get; set; }
|
||||
|
||||
public EventModel(string id)
|
||||
{
|
||||
Id = id;
|
||||
}
|
||||
|
||||
public EventModel(
|
||||
string id,
|
||||
string title,
|
||||
string description,
|
||||
DateTime date,
|
||||
string location,
|
||||
List<TagModel>? relatedTags = null,
|
||||
DateTime? createdAt = null,
|
||||
DateTime? updatedAt = null,
|
||||
string? createdBy = null,
|
||||
string? updatedBy = null)
|
||||
{
|
||||
Id = id;
|
||||
Title = title;
|
||||
Description = description;
|
||||
Date = date;
|
||||
Location = location;
|
||||
RelatedTags = relatedTags ?? [];
|
||||
CreatedAt = createdAt ?? DateTime.UtcNow;
|
||||
UpdatedAt = updatedAt ?? DateTime.UtcNow;
|
||||
CreatedBy = createdBy ?? "";
|
||||
UpdatedBy = updatedBy;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user