mirror of
https://bitbucket.org/myhomie/mycorerepository.git
synced 2025-12-06 09:41:19 +00:00
29 lines
647 B
C#
29 lines
647 B
C#
using MongoDB.Bson;
|
|
using MongoDB.Bson.Serialization.Attributes;
|
|
using MyCore.DTO.MyControlPanel;
|
|
|
|
namespace MyCore.Models.MyControlPanel
|
|
{
|
|
/// <summary>
|
|
/// Location of a device (Room name, garden, ..)
|
|
/// </summary>
|
|
public class Location
|
|
{
|
|
[BsonId]
|
|
[BsonRepresentation(BsonType.ObjectId)]
|
|
public string Id { get; set; }
|
|
|
|
[BsonElement("Name")]
|
|
[BsonRequired]
|
|
public string Name { get; set; }
|
|
|
|
public LocationDTO ToDTO()
|
|
{
|
|
return new LocationDTO()
|
|
{
|
|
Id = Id,
|
|
Name = Name
|
|
};
|
|
}
|
|
}
|
|
} |