Skip to content

Commit

Permalink
refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
liliankasem committed Jan 17, 2023
1 parent 0e68eb0 commit 21954b7
Showing 1 changed file with 13 additions and 6 deletions.
19 changes: 13 additions & 6 deletions sdk/Sdk/FunctionMetadataGenerator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -574,12 +574,6 @@ private static ExpandoObject BuildBindingMetadataFromAttribute(CustomAttribute a
return binding;
}

private static bool SupportsDeferredBinding(CustomAttribute attribute)
{
var typeDefinition = attribute.AttributeType.Resolve();
return typeDefinition.CustomAttributes.Any(a => a.AttributeType.FullName == Constants.SupportsDeferredBindingAttributeType);
}

private static bool IsIterableCollection(TypeReference type, out DataType dataType)
{
// Array and not byte array
Expand Down Expand Up @@ -801,6 +795,19 @@ private static string GetBindingDirection(CustomAttribute attribute)
return Constants.InputBindingDirection;
}

private static bool SupportsDeferredBinding(CustomAttribute attribute)
{
var typeDefinition = attribute?.AttributeType?.Resolve();

if (typeDefinition is null)
{
return false;
}

return typeDefinition.CustomAttributes
.Any(a => string.Equals(a.AttributeType.FullName, Constants.SupportsDeferredBindingAttributeType, StringComparison.Ordinal));
}

private static bool IsOutputBindingType(CustomAttribute attribute)
{
return TryGetBaseAttributeType(attribute, Constants.OutputBindingType, out _);
Expand Down

0 comments on commit 21954b7

Please sign in to comment.