28 lines
675 B
C#
Raw Normal View History

2024-05-20 15:00:47 -05:00
using DAL.Models;
using DAL.Values;
2024-05-20 15:00:47 -05:00
using System.ComponentModel.DataAnnotations;
namespace API.DTO.Base.Update
{
public class UserUpdateDTO : IUpdateAdaptable<User>
{
[MaxLength(64)]
public string? firstName { get; set; }
[MaxLength(64)]
public string? lastName { get; set; }
public PhoneNumber? phoneNumber { get; set; }
2024-05-20 15:00:47 -05:00
public ulong? permissionId { get; set; }
public void adaptModel(ref User model)
{
if (firstName != null) model.firstName = firstName;
if (lastName != null) model.lastName = lastName;
if (phoneNumber != null) model.phoneNumber = phoneNumber;
2024-05-20 15:00:47 -05:00
if (permissionId != null) model.permissionId = (ulong)permissionId;
}
}
}