My requirement is I have to read data from one service and push this data into different tables(t1,t2,t3 or many more)
For this I created one table to map data field from service to table name and field name.
Eg: fname belongs to user table first name field
Now I am looping through this and creating objects before hand and assigning values from data returned from service by using switch case
T1 objt1; T2 objT2; T3 objT3; For loop mapping data
Switch(mapping data field)
Case "T1":
var obj1 = entity.GetType().GetProperty(propertyName);
Obj1.SetValue(entity, data.Substring(1, data.Length - 2) == "Y", null);
break;
Case "T2":
// code
break;
Now how do we do this without creating instance of T1, T2 before hand and by not using switch case for every table type
We cannot use System.activator.createinstance because of performance issues with it
I want some solution using dictionary, so that we need not create instances of every class created