Closed uwerichter closed 3 years ago
I don't really understand this request.
If you have a collection of objects talkCNCPoint.MeasurementPoints
then you can just write...
DB.InsertBatch(tableName, talkCNCPoint.MeasurementPoints).ExecuteAsync();
It will infer the schema name from the table name. You don't have to use a SqlServerObjectName
directly.
We would like to do something like:
` public class Repository : DBDataSource { public Task Write(string tableName, List data, string dbschemaName = "dbo") where T : class, new()
{
var ss = new Tortuga.Chain.SqlServer.SqlServerObjectName("dbo", tableName);
return DB.InsertBatch(dbschemaName + "." + tableName, data.AsReadOnly()).ToObject().ExecuteAsync();
... } } new Repository().Write("ClassName", talkCNCPoint.MeasurementPoints);
The Ideas is some Generic Repository Class.