45 lines
No EOL
1.2 KiB
C#
45 lines
No EOL
1.2 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<HostOsEntity> HostOs(this IMongoDatabase database) => database.GetCollection<HostOsEntity>("host_os");
|
|
}
|
|
|
|
[BsonIgnoreExtraElements]
|
|
public class HostOsEntity
|
|
{
|
|
[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("name")]
|
|
public string? Name { get; set; }
|
|
|
|
[BsonElement("version")]
|
|
public string? Version { get; set; }
|
|
|
|
[BsonElement("architecture")]
|
|
public string? Architecture { get; set; }
|
|
|
|
[BsonElement("serialnumber")]
|
|
public string? SerialNumber { get; set; }
|
|
|
|
[BsonElement("virtual")]
|
|
public bool? Virtual { get; set; }
|
|
|
|
[BsonElement("installed")]
|
|
public DateTime? Installed { get; set; }
|
|
} |