39 lines
No EOL
1.1 KiB
C#
39 lines
No EOL
1.1 KiB
C#
using MongoDB.Bson;
|
|
using MongoDB.Bson.Serialization.Attributes;
|
|
using MongoDB.Driver;
|
|
using System.Text.Json.Serialization;
|
|
|
|
namespace Insight.Infrastructure.Entities;
|
|
|
|
public static partial class MongoDatabaseExtensions
|
|
{
|
|
public static IMongoCollection<HostSystemEntity> HostSystem(this IMongoDatabase database) => database.GetCollection<HostSystemEntity>("host_sys");
|
|
}
|
|
|
|
[BsonIgnoreExtraElements]
|
|
public class HostSystemEntity
|
|
{
|
|
[BsonId, BsonRepresentation(BsonType.ObjectId), JsonPropertyName("id")]
|
|
public string? Id { get; set; }
|
|
|
|
[BsonElement("_host"), BsonRepresentation(BsonType.ObjectId), JsonPropertyName("host")]
|
|
public string? Host { get; set; }
|
|
|
|
[BsonElement("insert")]
|
|
public DateTime? Insert { get; set; }
|
|
|
|
[BsonElement("update")]
|
|
public DateTime? Update { get; set; }
|
|
|
|
[BsonElement("localtime")]
|
|
public DateTime? LocalTime { get; set; }
|
|
|
|
[BsonElement("bootuptime")]
|
|
public DateTime? BootUpTime { get; set; }
|
|
|
|
[BsonElement("processes")]
|
|
public uint? Processes { get; set; }
|
|
|
|
[BsonElement("license")]
|
|
public string? License { get; set; }
|
|
} |