in Source/Actions/Microsoft.Deployment.Actions.Salesforce/SalesforceSqlArtefacts.cs [57:100]
public List<ADFField> ExtractSimpleMetadata(DescribeSObjectResult sfobject)
{
List<ADFField> simpleFields = new List<ADFField>();
foreach (var field in sfobject.fields)
{
// check to go around ADF unsupported fields
if (field.type != fieldType.address &&
field.type != fieldType.location &&
SupportedField(field))
{
var newField = new ADFField();
var rawField = field.type;
newField.name = field.name.ToLowerInvariant();
var cleanedField = field.type.ToString().Contains('@') ? field.type.ToString().Replace('@', ' ') : field.type.ToString();
var netType = TypeMapper.SalesforceToDotNet.Where(p => p.Key == cleanedField).FirstOrDefault();
Debug.WriteLine(string.Concat(field.name, ", ", rawField, ", ", cleanedField, ", ", netType.Value));
if (netType.Key != null)
{
if (netType.Value == "int")
{
if (field.digits <= 5)
{
newField.type = "Int16";
}
if (field.digits > 5 && field.digits <= 10)
{
newField.type = "Int32";
}
if (field.digits > 10 && field.digits <= 19)
{
newField.type = "Int64";
}
}
else
{
newField.type = netType.Value;
}
simpleFields.Add(newField);
}
}
}
return simpleFields;
}