48 lines
1.6 KiB
C#
48 lines
1.6 KiB
C#
// /**
|
|
// * File: SkyEntities.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 ln.skyscanner.entities;
|
|
using System.IO;
|
|
using LiteDB;
|
|
|
|
namespace ln.skyscanner
|
|
{
|
|
public class SkyEntities
|
|
{
|
|
public SkyScanner SkyScanner { get; }
|
|
public string BasePath => Path.Combine(SkyScanner.BasePath, "entities");
|
|
|
|
//public GlobalNetwork GlobalNetwork => DBGlobalNetwork.Root;
|
|
//public ODB<GlobalNetwork> DBGlobalNetwork { get; private set; }
|
|
|
|
public GlobalNetwork GlobalNetwork { get; private set; }
|
|
public LiteDatabase liteDatabase { get; private set; }
|
|
public LiteCollection<Node> nodeCollection { get; private set; }
|
|
public LiteCollection<NetworkInterface> interfaceCollection { get; private set; }
|
|
public LiteCollection<Subnet> subnetCollection { get; private set; }
|
|
|
|
public SkyEntities(SkyScanner skyScanner)
|
|
{
|
|
SkyScanner = skyScanner;
|
|
//DBGlobalNetwork = new ODB<GlobalNetwork>(BasePath);
|
|
|
|
liteDatabase = new LiteDatabase(String.Format(BasePath, "entities.db"));
|
|
nodeCollection = liteDatabase.GetCollection<Node>("nodes");
|
|
interfaceCollection = liteDatabase.GetCollection<NetworkInterface>("interfaces");
|
|
subnetCollection = liteDatabase.GetCollection<Subnet>("subnets");
|
|
|
|
GlobalNetwork = new GlobalNetwork(this);
|
|
}
|
|
|
|
|
|
}
|
|
}
|