From 777fb1c4c9df9346f143ba5c911ca63ab9c01b99 Mon Sep 17 00:00:00 2001 From: quentin Date: Tue, 29 Oct 2024 19:14:35 -0500 Subject: [PATCH] EventUpdateDTO when UnSettable --- API/DTO/Base/Update/EventUpdateDTO.cs | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/API/DTO/Base/Update/EventUpdateDTO.cs b/API/DTO/Base/Update/EventUpdateDTO.cs index 42965f2..34d7422 100644 --- a/API/DTO/Base/Update/EventUpdateDTO.cs +++ b/API/DTO/Base/Update/EventUpdateDTO.cs @@ -1,5 +1,4 @@ using DAL.Models; -using System.ComponentModel.DataAnnotations; namespace API.DTO.Base.Update { @@ -7,23 +6,23 @@ namespace API.DTO.Base.Update { public ulong? savedEventId { get; set; } - [MaxLength(64)] + // [MaxLength(64)] public UnSettable? name { get; set; } public UnSettable? bgColorId { get; set; } public UnSettable? fgColorId { get; set; } public UnSettable? imageId { get; set; } - public UnSettable? when { 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 = ((UnSettable)name).value; + if (name != null) model.name = name.Value.value; if (bgColorId != null) model.bgColorId = bgColorId.Value.value; - if (fgColorId != null) model.bgColorId = fgColorId.Value.value; + if (fgColorId != null) model.fgColorId = fgColorId.Value.value; if (imageId != null) model.imageId = imageId.Value.value; - if (when != null) model.when = when.Value.value; + if (when != null) model.when = (DateTime)when; if (hidden != null) model.hidden = (bool)hidden; } }