42 lines
944 B
C#
42 lines
944 B
C#
using ManagerService.DTOs;
|
|
using System;
|
|
using System.ComponentModel.DataAnnotations;
|
|
|
|
namespace ManagerService.Data
|
|
{
|
|
/// <summary>
|
|
/// Instance Information
|
|
/// </summary>
|
|
public class Instance
|
|
{
|
|
[Key]
|
|
[Required]
|
|
/*[BsonId]
|
|
[BsonRepresentation(MongoDB.Bson.BsonType.ObjectId)]*/
|
|
public string Id { get; set; }
|
|
|
|
/*[BsonElement("Name")]
|
|
[BsonRequired]*/
|
|
[Required]
|
|
public string Name { get; set; } // UNIQUE !..
|
|
|
|
/*[BsonElement("DateCreation")]*/
|
|
public DateTime DateCreation { get; set; }
|
|
|
|
/*[BsonElement("PinCode")]*/
|
|
public int? PinCode { get; set; }
|
|
|
|
public InstanceDTO ToDTO()
|
|
{
|
|
return new InstanceDTO()
|
|
{
|
|
id = Id,
|
|
name = Name,
|
|
dateCreation = DateCreation,
|
|
pinCode = PinCode
|
|
};
|
|
}
|
|
|
|
}
|
|
}
|