39 lines
1.0 KiB
C#
39 lines
1.0 KiB
C#
using System.Collections.Generic;
|
|
using System.ComponentModel.DataAnnotations;
|
|
using System.ComponentModel.DataAnnotations.Schema;
|
|
using System.Text.Json.Serialization;
|
|
|
|
namespace GazpromApp.Models;
|
|
|
|
public class Property
|
|
{
|
|
[Key]
|
|
[DatabaseGenerated(DatabaseGeneratedOption.Identity)]
|
|
[JsonIgnore]
|
|
public int Id { get; set; }
|
|
|
|
[Required]
|
|
public string Name { get; set; } = string.Empty;
|
|
public string Value { get; set; } = string.Empty;
|
|
|
|
// For self-referencing hierarchy (Property of a Property)
|
|
[JsonIgnore]
|
|
public int? ParentPropertyId { get; set; }
|
|
[JsonIgnore]
|
|
public Property? Parent { get; set; }
|
|
|
|
// For a Property of a Point
|
|
[JsonIgnore]
|
|
public int? PointId { get; set; }
|
|
[JsonIgnore]
|
|
public Point? Point { get; set; }
|
|
|
|
// For a Property of an Equipment
|
|
[JsonIgnore]
|
|
public int? EquipmentId { get; set; }
|
|
[JsonIgnore]
|
|
public Equipment? Equipment { get; set; }
|
|
|
|
// Child properties in the hierarchy
|
|
public List<Property> Properties { get; set; } = [];
|
|
} |