private void GetDataExtensionCustomerKey()
{
if (this.DataExtensionCustomerKey == null)
{
if (this.DataExtensionName != null)
{
ET_DataExtension lookupDE = new ET_DataExtension();
lookupDE.AuthStub = this.AuthStub;
lookupDE.Props = new string[] { "Name", "CustomerKey" };
lookupDE.SearchFilter = new SimpleFilterPart() { Property = "Name", SimpleOperator = SimpleOperators.equals, Value = new string[] { this.DataExtensionName } };
GetReturn grDEName = lookupDE.Get();
if (grDEName.Status && grDEName.Results.Length > 0)
{
this.DataExtensionCustomerKey = ((ET_DataExtension)grDEName.Results[0]).CustomerKey;
}
else
{
throw new Exception("Unable to process ET_DataExtensionRow request due to unable to find DataExtension based on DataExtensionName provided.");
}
}
else
{
throw new Exception("Unable to process ET_DataExtensionRow request due to DataExtensionCustomerKey or DataExtensionName not being defined on ET_DatExtensionRow");
}
}
}