Skip to content

Commit

Permalink
Implement bypass deferred binding (Azure#1462)
Browse files Browse the repository at this point in the history
Implement bypass deferred binding
  • Loading branch information
surgupta-msft authored and JoshLove-msft committed Oct 4, 2023
1 parent 366b226 commit 2a25172
Show file tree
Hide file tree
Showing 9 changed files with 924 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
using Microsoft.Azure.Functions.Worker.Extensions.Storage.Blobs;
using Microsoft.Extensions.Options;
using Microsoft.Extensions.Logging;
using Microsoft.Azure.Functions.Worker.Extensions.Abstractions;

namespace Microsoft.Azure.Functions.Worker
{
Expand Down
6 changes: 6 additions & 0 deletions samples/WorkerBindingSamples/NuGet.Config
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<packageSources>
<add key="nuget.org" value="https://api.nuget.org/v3/index.json" protocolVersion="3" />
</packageSources>
</configuration>
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
// Copyright (c) .NET Foundation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.

using System;

namespace Microsoft.Azure.Functions.Worker.Converters
{
/// <summary>
/// An attribute that specifies if Converter fallback is allowed
/// </summary>
[AttributeUsage(AttributeTargets.Class)]
public sealed class AllowConverterFallbackAttribute : Attribute
{
/// <summary>
/// Gets the value of whether Converter fallback is allowed.
/// </summary>
public bool AllowConverterFallback { get; }

/// <summary>
/// Creates a new instance of <see cref="AllowConverterFallbackAttribute"/>
/// </summary>
/// <param name="allowConverterFallback">The value to indicate if converter fallback is allowed.</param>
public AllowConverterFallbackAttribute(bool allowConverterFallback)
{
AllowConverterFallback = allowConverterFallback;
}

}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
// Copyright (c) .NET Foundation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.

using System;

namespace Microsoft.Azure.Functions.Worker.Converters
{
/// <summary>
/// An attribute that can specify a type supported by function input conversion.
/// </summary>
[AttributeUsage(AttributeTargets.Class, AllowMultiple = true)]
public sealed class SupportedConverterTypeAttribute : Attribute
{
/// <summary>
/// Gets the input converter type.
/// </summary>
public Type Type { get; }

/// <summary>
/// Creates a new instance of <see cref="SupportedConverterTypeAttribute"/>
/// </summary>
/// <param name="type">Input converter type.</param>
/// <exception cref="ArgumentNullException">Thrown when type is null</exception>
public SupportedConverterTypeAttribute(Type type)
{
Type = type ?? throw new ArgumentNullException(nameof(type));
}
}
}
1 change: 1 addition & 0 deletions test/DotNetWorkerTests/DotNetWorkerTests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\..\extensions\Worker.Extensions.Storage.Blobs\src\Worker.Extensions.Storage.Blobs.csproj" />
<ProjectReference Include="..\..\extensions\Worker.Extensions.Abstractions\src\Worker.Extensions.Abstractions.csproj" />
<ProjectReference Include="..\..\extensions\Worker.Extensions.Http.AspNetCore\src\Worker.Extensions.Http.AspNetCore.csproj" />
<ProjectReference Include="..\..\extensions\Worker.Extensions.Http\src\Worker.Extensions.Http.csproj" />
Expand Down

0 comments on commit 2a25172

Please sign in to comment.