ln.skyscanner/entities/PointOfPresence.cs

46 lines
1.2 KiB
C#

// /**
// * File: PointOfPresence.cs
// * Author: haraldwolff
// *
// * This file and it's content is copyrighted by the Author and / or copyright holder.
// * Any use wihtout proper permission is illegal and may lead to legal actions.
// *
// *
// **/
using System;
using ln.types.odb;
using System.Collections.Generic;
using System.Linq;
using ln.types;
using ln.types.odb.attributes;
using Newtonsoft.Json;
namespace ln.skyscanner.entities
{
public class PointOfPresence
{
[DocumentID]
public Guid ID = Guid.NewGuid();
public String Name { get; set; }
public String ForeignName { get; set; }
public GeoLocation GeoLocation { get; set; }
[JsonIgnore]
public Node[] Nodes => SkyScanner.Instance.Entities.nodeCollection.Query(Query.Equals<Node>("ID", nodeIDList.Select(id => ODBMapper.Default.MapValue(id)).ToArray())).ToArray();
HashSet<Guid> nodeIDList = new HashSet<Guid>();
public DateTime Created { get; private set; } = DateTime.Now;
public PointOfPresence()
{
}
public void AddNode(Node node) => nodeIDList.Add(node.ID);
public void RemoveNode(Node node) => nodeIDList.Remove(node.ID);
}
}