Hi guys, I need to change the class structure on my project and I wanted to do it in the most efficient way, which I do not know yet. I have a Account class which now needs to be a abstract class with other classes like DebitCard, CreditCard, Broker and others. When creating a new account what defines the account type right now is a string type, which I need to use to created the actual classes.
I was about to do a big switch case which I think might not be a good solution, so I came here to ask for help, I want to know what is the best way to handle this. In TypeScript there is Discriminated Unions, but this typing feature does not exist in C#, what is the best and most efficient way to solve this? I want to make a understandable code which will be easy to maintain in the future, Thanks!