Hi,
Hoping I could have some guidance on this one.
I have a base class, and a few classes that extend it. This is all working fine, however I need a way to instantiate variables via some templating. bellow is my current implementation

current implementation
However I would like something like the following

desired implementation

How would I go about implementing this. I have been using c# for a good few years now, but still fairly new to abstraction.

Thanks 🙂

EDIT:
Managed to solve it using my desired implementation and u/danglesReet‘s suggestion
Just need to decide which I prefer.
solved 2 ways
Have you considered using reflection to Instantiate your types? You can use some abstract methods that return those types and shorten the code considerably
I have not no, I can see where it needs trimming. Far too much duplication here.
Do you have any examples? Or a link for me to study?
Thanks.
C# devs
null reference exceptions

source