Adding point works
This commit is contained in:
@@ -0,0 +1,24 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace GazpromApp.Models;
|
||||
|
||||
public class Equipment
|
||||
{
|
||||
[Key]
|
||||
[DatabaseGenerated(DatabaseGeneratedOption.Identity)]
|
||||
public int Id { get; set; }
|
||||
[Required]
|
||||
public string Name { get; set; } = string.Empty;
|
||||
[Required]
|
||||
public string Description { get; set; } = string.Empty;
|
||||
[Required]
|
||||
public int PointId { get; set; }
|
||||
public int ImageId { get; set; }
|
||||
|
||||
// EF stuff
|
||||
public Image? Image { get; set; }
|
||||
public Models.Point? Point { get; set; }
|
||||
public List<Property> Properties { get; } = [];
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
|
||||
namespace GazpromApp.Models;
|
||||
public class Image
|
||||
{
|
||||
|
||||
[Key]
|
||||
[DatabaseGenerated(DatabaseGeneratedOption.Identity)]
|
||||
public int Id { get; set; }
|
||||
[Required]
|
||||
public byte[] Bytes { get; set; } = [];
|
||||
// EF stuff
|
||||
public List<Point> Points { get; set; } = [];
|
||||
public List<Equipment> Equipment { get; set; } = [];
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
|
||||
namespace GazpromApp.Models;
|
||||
|
||||
public class Point
|
||||
{
|
||||
[Key]
|
||||
[DatabaseGenerated(DatabaseGeneratedOption.Identity)]
|
||||
public int Id { get; set; }
|
||||
[Required]
|
||||
public string? Name { get; set; } = string.Empty;
|
||||
[Required]
|
||||
public string? Description { get; set; } = string.Empty;
|
||||
[Required]
|
||||
public double Latitude { get; set; } = 0;
|
||||
[Required]
|
||||
public double Longitude { get; set; } = 0;
|
||||
// EF stuff
|
||||
public List<Image> Images { get; set; } = [];
|
||||
public List<Equipment> Equipment { get; set; } = [];
|
||||
public List<Property> Properties { get; } = [];
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
namespace GazpromApp.Models;
|
||||
|
||||
public class Property
|
||||
{
|
||||
[Key]
|
||||
[DatabaseGenerated(DatabaseGeneratedOption.Identity)]
|
||||
public int Id { get; set; }
|
||||
public int ParentId { get; set; }
|
||||
[Required]
|
||||
public string Name { get; set; } = string.Empty;
|
||||
public string Value { get; set; } = string.Empty;
|
||||
public List<Models.Point> Points { get; set; } = [];
|
||||
public List<Equipment> Equipment { get; } = [];
|
||||
}
|
||||
Reference in New Issue
Block a user