36 lines
633 B
C#
36 lines
633 B
C#
using DAL.Models;
|
|
using System.ComponentModel.DataAnnotations;
|
|
|
|
namespace API.DTO.Base
|
|
{
|
|
public class PermissionDTO : IAdaptable<Permission>
|
|
{
|
|
public ulong id { get; set; }
|
|
|
|
[MaxLength(64)]
|
|
public string name { get; set; } = null!;
|
|
|
|
public DateTime updated { get; set; }
|
|
|
|
public ulong updater { get; set; }
|
|
|
|
public Permission adaptToModel()
|
|
{
|
|
return new Permission
|
|
{
|
|
id = id,
|
|
name = name,
|
|
updated = updated,
|
|
updater = updater
|
|
};
|
|
}
|
|
public void adaptFromModel(in Permission model)
|
|
{
|
|
id = model.id;
|
|
name = model.name;
|
|
updated = model.updated;
|
|
updater = model.updater;
|
|
}
|
|
}
|
|
}
|