Adding equipment works
This commit is contained in:
+4
-2
@@ -10,15 +10,17 @@ public class Equipment
|
||||
[DatabaseGenerated(DatabaseGeneratedOption.Identity)]
|
||||
public int Id { get; set; }
|
||||
[Required]
|
||||
public string Name { get; set; } = string.Empty;
|
||||
public string? Name { get; set; } = string.Empty;
|
||||
[Required]
|
||||
public string Description { get; set; } = string.Empty;
|
||||
public string? Description { get; set; } = string.Empty;
|
||||
[Required]
|
||||
public int PointId { get; set; }
|
||||
public int ImageId { get; set; }
|
||||
public List<int> InspectionIds { get; set; } = [];
|
||||
|
||||
// EF stuff
|
||||
public Image? Image { get; set; }
|
||||
public Models.Point? Point { get; set; }
|
||||
public List<Property> Properties { get; } = [];
|
||||
public List<Inspection> Inspections { get; } = [];
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
using System;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
|
||||
namespace GazpromApp.Models;
|
||||
|
||||
public class Inspection
|
||||
{
|
||||
[Key]
|
||||
[DatabaseGenerated(DatabaseGeneratedOption.Identity)]
|
||||
public int Id { get; set; }
|
||||
[Required]
|
||||
public string Name { get; set; } = string.Empty;
|
||||
[Required]
|
||||
public DateTime InspectionDate { get; set; }
|
||||
public int EquipmentId { get; set; }
|
||||
|
||||
// EF stuff
|
||||
public Equipment? Equipment { get; set; }
|
||||
}
|
||||
+1
-1
@@ -20,5 +20,5 @@ public class Point
|
||||
// EF stuff
|
||||
public List<Image> Images { get; set; } = [];
|
||||
public List<Equipment> Equipment { get; set; } = [];
|
||||
public List<Property> Properties { get; } = [];
|
||||
public List<Property> Properties { get; set; } = [];
|
||||
}
|
||||
Reference in New Issue
Block a user