using DAL.Models; using System.ComponentModel.DataAnnotations; namespace API.DTO.Base { public class SavedEventDTO : IAdaptable { public ulong id { get; set; } [MaxLength(64)] public string name { get; set; } = null!; public ulong bgColorId { get; set; } public ulong fgColorId { get; set; } public ulong? imageId { get; set; } public DateTime updated { get; set; } public ulong updater { get; set; } public SavedEvent adaptToModel() { return new SavedEvent { id = id, name = name, bgColorId = bgColorId, fgColorId = fgColorId, imageId = imageId, updated = updated, updater = updater }; } public void adaptFromModel(in SavedEvent model) { id = model.id; name = model.name; bgColorId = model.bgColorId; fgColorId = model.fgColorId; imageId = model.imageId; updated = model.updated; updater = model.updater; } } }