49 lines
1.2 KiB
C#
49 lines
1.2 KiB
C#
using ManagerService.DTOs;
|
|
using MongoDB.Bson.Serialization.Attributes;
|
|
using System;
|
|
using System.ComponentModel.DataAnnotations;
|
|
|
|
namespace ManagerService.Data
|
|
{
|
|
/// <summary>
|
|
/// Resource Information
|
|
/// </summary>
|
|
public class OldResource
|
|
{
|
|
[BsonId]
|
|
[BsonRepresentation(MongoDB.Bson.BsonType.ObjectId)]
|
|
public string Id { get; set; }
|
|
|
|
[BsonElement("Type")]
|
|
[BsonRequired]
|
|
public ResourceType Type { get; set; }
|
|
|
|
[BsonElement("Label")]
|
|
[BsonRequired]
|
|
public string Label { get; set; }
|
|
|
|
[BsonElement("DateCreation")]
|
|
public DateTime DateCreation { get; set; }
|
|
|
|
[BsonElement("InstanceId")]
|
|
[BsonRequired]
|
|
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
|
|
};
|
|
}
|
|
}
|
|
}
|