using Manager.Interfaces.DTO; using MongoDB.Bson.Serialization.Attributes; using System; using System.Collections.Generic; using System.Text; namespace Manager.Interfaces.Models { /// /// Section Information /// public class Section { [BsonId] [BsonRepresentation(MongoDB.Bson.BsonType.ObjectId)] public string Id { get; set; } [BsonElement("Label")] [BsonRequired] public string Label { get; set; } // Dictionary with all languages [BsonElement("ImageId")] [BsonRequired] public string ImageId { get; set; } [BsonElement("Type")] [BsonRequired] public SectionType Type { get; set; } [BsonElement("IsSubSection")] [BsonRequired] public bool IsSubSection { get; set; } [BsonElement("ParentId")] public string ParentId { get; set; } // only if it's an subsection [BsonElement("Data")] public string Data { get; set; } // Json encapsulated info [BsonElement("DateCreation")] public DateTime DateCreation { get; set; } public SectionDTO ToDTO() { return new SectionDTO() { Id = Id, Label = Label, Type = Type, ImageId = ImageId }; } } public enum SectionType { Map, Slider, Video, Web, Menu } }