Reputation: 365
Writing a table-driven data mapping engine, which references its tables as variables/properties.
But how to execute methods on List objects when they are identified as the value of a property?
...for Example, in literal code, with a dbSet "Customers" and dbContext "dbc", one could insert a Customer record with :
dbc.Customers.Add(Customer);
But if "Customers" is identified as a variable...
var dbSetName = "Customers"
...is there some way to abstractly execute the same record insertion, e.g.:
dbc.[dbSetName].Add(Customer)
Upvotes: 0
Views: 60