-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathModuleHost.cs
More file actions
36 lines (33 loc) · 1.17 KB
/
ModuleHost.cs
File metadata and controls
36 lines (33 loc) · 1.17 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
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
[Table("ModuleHost", Schema = "common")]
public class ModuleHost
{
[Key]
public int Id { get; init; }
public Request Requests { get; set; }
public Guid ReadingRequestGuid { get; set; }
public virtual ModuleHostType ModuleHostType { get; set; }
public string ModuleHostTypeName
{
set => ModuleHostType = (ModuleHostType)Enum.Parse(typeof(ModuleHostType), value, true);
get => ModuleHostType.ToString();
}
}
public class ModuleHostA : ModuleHost
{
public override ModuleHostType ModuleHostType { get => ModuleHostType.VariantA; }
public virtual ICollection<ModuleVariantA> Modules { get; init; } = new List<ModuleVariantA>();
}
public class ModuleHostB : ModuleHostA
{
public override ModuleHostType ModuleHostType { get => ModuleHostType.VariantA; }
}
public class ModuleHostC : ModuleHost
{
public override ModuleHostType ModuleHostType { get => ModuleHostType.VariantC; }
public virtual ICollection<ModuleVariantB> ModuleVariantBs { get; init; } = new List<ModuleVariantB>();
}
public class UnknownModuleHost : ModuleHost
{
}