How to return multiple types of data in C#
How to return multiple types of data in C# I do return different instances of service depending on a enum in my application: public (????) CurrentService { get { switch (CurrentServiceEnum) { case ServiceType.ServiceA: return IoC.ServiceA; case ServiceType.ServiceB: return IoC.ServiceB; case ServiceType.ServiceC: return IoC.ServiceC; } } } Each of that service has it's own implementation of RemoveAccount method, taking different type argument. RemoveAccount internal class ServiceA_AccountDataModel { [..] } internal class ServiceB_AccountDataModel { [..] } internal class ServiceC_AccountDataModel { [..] } public class ServiceA { public void RemoveAccount(ServiceA_AccountDataModel model) { [...] } } public class ServiceB { public void RemoveAccount(ServiceB_AccountDataModel model) { [...] } } public class ServiceC { public void RemoveAccount(ServiceC_A...
