using DAL.Models; using System.ComponentModel.DataAnnotations; 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 bool? hidden { get; set; } public void adaptModel(ref Event model) { if (savedEventId != null) model.savedEventId = (ulong)savedEventId; if (name != null) model.name = ((UnSettable)name).value; if (bgColorId != null) model.bgColorId = bgColorId.Value.value; if (fgColorId != null) model.bgColorId = fgColorId.Value.value; if (imageId != null) model.imageId = imageId.Value.value; if (hidden != null) model.hidden = (bool)hidden; } } }