I have to create 2 lists and i am looking for the best practice and eventually oneline syntax!
I am using Entity Framework and I have 3 tables:
public class Position
{
public int ID { get; set; }
public string Name { get; set; }
}
public class Training
{
public int Id { get; set; }
public string Name { get; set; }
}
public class Association
{
public int Id { get; set; }
public Impact Impact { get; set; }
public int TrainingId { get; set; }
public virtual Training Training { get; set; }
public int PositionId { get; set; }
public virtual Position Position { get; set; }
}
public enum Impact
{
Optional,
Mandatory
}
I have to select all the training which are mentioned in Association table as mandatory or optional (I mean that must have the column Impact fill with Impact.Optional) and the PositionId is the one that I give it through a parameter or something!
How can I do that?

TrainingIdto take the training list!