in SamplesV1/ADFCustomActivityRunner/CustomActivityRunner/CustomActivityBase.cs [121:134]
public T GetLinkedService<T>(string name) where T : class
{
int linkedServiceCount = LinkedServices.Count(x => x.Name == name);
if (linkedServiceCount == 0)
{
throw new Exception($"The linked service '{name}' was not found.");
}
if (linkedServiceCount > 1)
{
throw new Exception($"More than one linked service with name '{name}' were found. Only one should exist.");
}
return LinkedServices.First(x => x.Name == name).Properties.TypeProperties as T;
}