using DAL.Models; namespace API.DTO.Base.Update { public class EventUpdateDTO : IUpdateAdaptable { public ulong? savedEventId { get; set; } // [MaxLength(64)] public UnSettable? name { get; set; } public UnSettable? bgColorId { get; set; } public UnSettable? fgColorId { get; set; } public UnSettable? imageId { get; set; } public DateTime? when { get; set; } public bool? hidden { get; set; } public void adaptModel(ref Event model) { if (savedEventId != null) model.savedEventId = (ulong)savedEventId; if (name != null) model.name = name.Value.value; if (bgColorId != null) model.bgColorId = bgColorId.Value.value; if (fgColorId != null) model.fgColorId = fgColorId.Value.value; if (imageId != null) model.imageId = imageId.Value.value; if (when != null) model.when = (DateTime)when; if (hidden != null) model.hidden = (bool)hidden; } } }