DB integration added, multiple images for equipment
This commit is contained in:
+19
-8
@@ -1,5 +1,4 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
using System.Text.Json.Serialization;
|
||||
@@ -12,17 +11,29 @@ public class Property
|
||||
[DatabaseGenerated(DatabaseGeneratedOption.Identity)]
|
||||
[JsonIgnore]
|
||||
public int Id { get; set; }
|
||||
[JsonIgnore]
|
||||
public int ParentId { get; set; }
|
||||
|
||||
[Required]
|
||||
public string Name { get; set; } = string.Empty;
|
||||
public string Value { get; set; } = string.Empty;
|
||||
// EF stuff
|
||||
|
||||
// For self-referencing hierarchy (Property of a Property)
|
||||
[JsonIgnore]
|
||||
public int? ParentPropertyId { get; set; }
|
||||
[JsonIgnore]
|
||||
public Property? Parent { get; set; }
|
||||
public List<Property> Properties{ get; set; } = [];
|
||||
|
||||
// For a Property of a Point
|
||||
[JsonIgnore]
|
||||
public List<Point> Points { get; set; } = [];
|
||||
public int? PointId { get; set; }
|
||||
[JsonIgnore]
|
||||
public List<Equipment> Equipment { get; } = [];
|
||||
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; } = [];
|
||||
}
|
||||
Reference in New Issue
Block a user