68 lines
1.8 KiB
C#
68 lines
1.8 KiB
C#
using ManagerService.DTOs;
|
|
using System;
|
|
using System.ComponentModel.DataAnnotations;
|
|
|
|
namespace ManagerService.Data
|
|
{
|
|
/// <summary>
|
|
/// Instance Information
|
|
/// </summary>
|
|
public class Instance
|
|
{
|
|
[Key]
|
|
[Required]
|
|
public string Id { get; set; }
|
|
|
|
[Required]
|
|
public string Name { get; set; } // UNIQUE !..
|
|
|
|
public DateTime DateCreation { get; set; }
|
|
|
|
public string PinCode { get; set; }
|
|
|
|
public bool IsPushNotification { get; set; }
|
|
|
|
public bool IsStatistic { get; set; }
|
|
|
|
public bool IsMobile { get; set; }
|
|
|
|
public bool IsTablet { get; set; }
|
|
|
|
public bool IsVR { get; set; }
|
|
|
|
|
|
public InstanceDTO ToDTO()
|
|
{
|
|
return new InstanceDTO()
|
|
{
|
|
id = Id,
|
|
name = Name,
|
|
dateCreation = DateCreation,
|
|
pinCode = PinCode,
|
|
isPushNotification = IsPushNotification,
|
|
isStatistic = IsStatistic,
|
|
isMobile = IsMobile,
|
|
isTablet = IsTablet,
|
|
isVR = IsVR,
|
|
};
|
|
}
|
|
|
|
public Instance FromDTO(InstanceDTO instanceDTO)
|
|
{
|
|
return new Instance()
|
|
{
|
|
Id = instanceDTO.id,
|
|
Name = instanceDTO.name,
|
|
DateCreation = instanceDTO.dateCreation != null ? instanceDTO.dateCreation.Value : DateTime.Now.ToUniversalTime(),
|
|
PinCode = instanceDTO.pinCode,
|
|
IsPushNotification = instanceDTO.isPushNotification,
|
|
IsStatistic = instanceDTO.isStatistic,
|
|
IsMobile = instanceDTO.isMobile,
|
|
IsTablet = instanceDTO.isTablet,
|
|
IsVR = instanceDTO.isVR
|
|
};
|
|
}
|
|
|
|
}
|
|
}
|