using ManagerService.DTOs; using System; using System.ComponentModel.DataAnnotations; namespace ManagerService.Data { /// /// Resource Information /// public class Resource { [Key] [Required] /*[BsonId] [BsonRepresentation(MongoDB.Bson.BsonType.ObjectId)]*/ public string Id { get; set; } /*[BsonElement("Type")] [BsonRequired]*/ [Required] public ResourceType Type { get; set; } /*[BsonElement("Label")] [BsonRequired]*/ [Required] public string Label { get; set; } /*[BsonElement("DateCreation")]*/ public DateTime DateCreation { get; set; } /*[BsonElement("InstanceId")] [BsonRequired]*/ [Required] public string InstanceId { get; set; } /*[BsonElement("URL")]*/ public string Url { get; set; } // Firebase url public ResourceDTO ToDTO() { return new ResourceDTO() { id = Id, label = Label, type = Type, url = Url, dateCreation = DateCreation, instanceId = InstanceId }; } } public enum ResourceType { Image, Video, ImageUrl, VideoUrl, Audio, PDF, JSON, JSONUrl } }