2021-04-06 18:17:23 +02:00

50 lines
1.3 KiB
C#

using Manager.Interfaces.DTO;
using MongoDB.Bson.Serialization.Attributes;
using System;
using System.Collections.Generic;
using System.Text;
namespace Manager.Interfaces.Models
{
/// <summary>
/// Display Information
/// </summary>
public class Display
{
[BsonId]
[BsonRepresentation(MongoDB.Bson.BsonType.ObjectId)]
public string Id { get; set; }
[BsonElement("Label")]
[BsonRequired]
public string Label { get; set; }
[BsonElement("PrimaryColor")]
public string PrimaryColor { get; set; }
[BsonElement("SecondaryColor")]
public string SecondaryColor { get; set; }
[BsonElement("SectionIds")]
public List<string> SectionIds { get; set; }
[BsonElement("Languages")]
public List<string> Languages { get; set; } // fr, en, de, nl => Sélection dans une liste déjà établie dans l'application !
[BsonElement("DateCreation")]
public DateTime DateCreation { get; set; }
public DisplayDTO ToDTO()
{
return new DisplayDTO()
{
Id = Id,
Label = Label,
DateCreation = DateCreation,
PrimaryColor = PrimaryColor,
SecondaryColor = SecondaryColor
};
}
}
}