В .NET Core DataTable заменяется на
List<SqlDataRecord>
Пример:
private SqlParameter CreateTableGuidParameter(string name, Guid[] ids)
{
var tableParam = new SqlParameter(name, SqlDbType.Structured);
tableParam.TypeName = "[dbo].[TableUniqueIdentifierType]";
tableParam.Direction = ParameterDirection.Input;
var rows = new List<SqlDataRecord>();
var sqlMetaData = new SqlMetaData("Id", SqlDbType.UniqueIdentifier);
foreach (var id in ids)
{
var row = new SqlDataRecord(sqlMetaData);
row.SetValues(id);
rows.Add(row);
}
tableParam.Value = rows;
return tableParam;
}