CommunicationConfig.cs
1.26 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
using DataAcquisition.Common.Enums;
using Microsoft.EntityFrameworkCore;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using IndexAttribute = Microsoft.EntityFrameworkCore.IndexAttribute;
namespace DataAcquisition.Models
{
[Comment("设备通讯配置")]
[Table("CommunicationConfig")]
[Index(nameof(Code), IsUnique = true)]
public class CommunicationConfig
{
public CommunicationConfig()
{
Equipments = new List<Equipment>();
}
[Key]
[Comment("主键")]
public int Id { get; set; }
[Comment("编号")]
public string Code { get; set; } = null!;
[Comment("名称")]
public string Name { get; set; } = null!;
[Comment("通讯方式")]
public CommunicationTypeConst CommunicationType { get; set; } = CommunicationTypeConst.None;
[Comment("IP地址")]
public string IpAddress { get; set; } = null!;
[Comment("端口号")]
public int Port { get; set; }
[Comment("是否启用")]
public bool Enable { get; set; }
[Comment("备注")]
public string? Remark { get; set; }
public virtual IList<Equipment> Equipments { get; set; }
}
}