I have these three models:
public class Equipment
{
public int ID { get; set; }
public string title { get; set; }
}
[Table("Vessels")]
public class Vessel:Equipment
{
public string Size { get; set; }
}
[Table("Tubes")]
public class Tube : Equipment
{
public string Pressure{ get; set; }
}
I want to show a list of Equipments with 2 columns title and type.
for example:
Title Type
------ -------
101-1 vessel
101-2 vessel
102-3 tube
I don't know how to make a discriminator column in Equipments to show the type of each equipments.
EDITED
If I have a discriminator in Equipment entity like:
public class Equipment
{
public int ID { get; set; }
public string title { get; set; }
public string type{ get; set; } //as discriminator
}
I can get the query in controller or repository like this:
var equipments=from e in db.Equipments
select e;