sanAntonioSeniorGolf/API/DTO/Base/Update/EventUpdateDTO.cs

30 lines
931 B
C#
Raw Normal View History

2024-05-20 15:00:47 -05:00
using DAL.Models;
namespace API.DTO.Base.Update
{
public class EventUpdateDTO : IUpdateAdaptable<Event>
{
public ulong? savedEventId { get; set; }
2024-10-29 19:14:35 -05:00
// [MaxLength(64)]
2024-05-20 15:00:47 -05:00
public UnSettable<string?>? name { get; set; }
public UnSettable<ulong?>? bgColorId { get; set; }
public UnSettable<ulong?>? fgColorId { get; set; }
public UnSettable<ulong?>? imageId { get; set; }
2024-10-29 19:14:35 -05:00
public DateTime? when { get; set; }
2024-05-20 15:00:47 -05:00
public bool? hidden { get; set; }
public void adaptModel(ref Event model)
{
if (savedEventId != null) model.savedEventId = (ulong)savedEventId;
2024-10-29 19:14:35 -05:00
if (name != null) model.name = name.Value.value;
2024-05-20 15:00:47 -05:00
if (bgColorId != null) model.bgColorId = bgColorId.Value.value;
2024-10-29 19:14:35 -05:00
if (fgColorId != null) model.fgColorId = fgColorId.Value.value;
2024-05-20 15:00:47 -05:00
if (imageId != null) model.imageId = imageId.Value.value;
2024-10-29 19:14:35 -05:00
if (when != null) model.when = (DateTime)when;
2024-05-20 15:00:47 -05:00
if (hidden != null) model.hidden = (bool)hidden;
}
}
}