有没有更快的方法来获取 ssis 的 oData?
public override void CreateNewOutputRows()
{
SomeEntities entities = new SomeEntities(new Uri("https://aurltomystuff.com/mywebservice.svc/"));
string username = this.Variables.username;
string domain = this.Variables.domain;
string password = this.Variables.password;
entities.Credentials = new NetworkCredential(username,password, domain);
var tbl = from t in entities.AnEntitySetInMyService
select new
{
AField = t.AField,
AField = t.AField,
AField = t.AField,
AField = t.AField,
AField = t.AField,
AField = t.AField
};
int pageSize = 500;
int recordCount = this.Variables.recordCount;
int page = 0;
while (page * pageSize < recordCount)
{
if ((page + 1) * pageSize > recordCount) { recordCount = tbl.Count(); }
foreach (var t in tbl.Skip(page * pageSize).Take(pageSize))
{
Output0Buffer.AddRow();
Output0Buffer.AField = t.AField ;
Output0Buffer.AField = t.AField ;
if (t.AField == null) { Output0Buffer.AField_IsNull = true; } else { Output0Buffer.AField = (long)t.AField ; }
if (t.AField == null) { Output0Buffer.AField_IsNull = true; } else { Output0Buffer.AField = (DateTime)t.AField; }
Output0Buffer.AField = t.AField;
Output0Buffer.AField = t.AField;
}
page++;
}
}