I have the following classes in order to build a List of Flow
public abstract class Flow
{
public string Name { get; set; }
}
public class Flow<T> : Flow
{
public Entity<Personnel, T> MyEntity { get; set; }
}
Here is my list of Flow (each Flow are of type Flow, where T can be different)
private List<Flow> _flow = new List<Flow>();
Then I have added some Flow into my List :
_flow.Add(new Flow<Type1>() { MyEntity = new ... , FileName = ... });
_flow.Add(new Flow<Type2>() { MyEntity = new ... , FileName = ... });
_flow.Add(new Flow<Type3>() { MyEntity = new ... , FileName = ... });
_flow.Add(new Flow<Type4>() { MyEntity = new ... , FileName = ... });
And finally, I want to call the function Entity.Map on each element of the list as below but this is not working :
foreach (var flow in _flow)
{
var currentResult= flow.MyEntity.Map();
var currentFilename = flow.FileName;
...
}
It tells me "Flow does not contain a definition for MyEntity"