The problem is I have 4 tables, Table 1, Table 2, Table 3 and Table 4. Table 1 has one-to-many relations with Table-2, Table 2 one-to-many to Table 3 and so on. all are similar on content, tables content below
- public class HazardsClass
- {
- [Key]
- public int IdHC { get; set; }
- public string HazClass { get; set; }
- public ICollection<HazardsDetail> HazardsDetails { get; set; }
- }
-
- public class HazardsDetail
- {
- [Key]
- public int IdH { get; set; }
- public string HazDetail { get; set; }
- public int IdHC { get; set; }
- [ForeignKey("IdHC")]
- public HazardsClass HazardsClass { get; set; }
-
- public ICollection<HazardsPMClass> HazardsPMClasses { get; set; }
- }
-
- public class HazardsPMClass
- {
- [Key]
- public int IdPMC { get; set; }
- public string HazPMClass { get; set; }
- public int IdH { get; set; }
- [ForeignKey("IdH")]
- public HazardsDetail HazardsDetail { get; set; }
- public ICollection<HazardsPMDetail> HazardsPMDetails { get; set; }
- }
-
- public class HazardsPMDetail
- {
- [Key]
- public int IdPM { get; set; }
- public string HazPMDetail { get; set; }
- public int IdPMC { get; set; }
- [ForeignKey("IdPMC")]
- public HazardsPMClass HazardsPMClass { get; set; }
- }
My problem is to view the information in dropdown lists, ex. First I choose a HazClass then from the list I choose a HazDetails and so on.
How do I do that?