-
Notifications
You must be signed in to change notification settings - Fork 167
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
- Loading branch information
1 parent
d54452e
commit 35c6ad8
Showing
12 changed files
with
300 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 16 additions & 0 deletions
16
extensions/Worker.Extensions.Abstractions/src/SupportsDeferredBindingAttribute.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
// 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.Extensions.Abstractions | ||
{ | ||
/// <summary> | ||
/// Specifies if a binding attribute supports deferred binding when generating function metadata. | ||
/// This is to be used on input, output or trigger attributes that support deferred binding. | ||
/// </summary> | ||
[AttributeUsage(AttributeTargets.Class)] | ||
public class SupportsDeferredBindingAttribute : Attribute | ||
{ | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
// Copyright (c) .NET Foundation. All rights reserved. | ||
// Licensed under the MIT License. See License.txt in the project root for license information. | ||
|
||
namespace Microsoft.Azure.Functions.Worker.Core | ||
{ | ||
/// <summary> | ||
/// A representation of Collection of Microsoft.Azure.WebJobs.ParameterBindingData | ||
/// </summary> | ||
public abstract class CollectionModelBindingData | ||
{ | ||
/// <summary> | ||
/// Gets the array of ModelBindingData | ||
/// </summary> | ||
public abstract ModelBindingData[] ModelBindingDataArray { get; } | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
// 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.Core | ||
{ | ||
/// <summary> | ||
/// A representation of a Microsoft.Azure.WebJobs.ParameterBindingData | ||
/// </summary> | ||
public abstract class ModelBindingData | ||
{ | ||
/// <summary> | ||
/// Gets the version of the binding data content | ||
/// </summary> | ||
public abstract string Version { get; } | ||
|
||
/// <summary> | ||
/// Gets the extension source of the binding data i.e CosmosDB, AzureStorageBlobs | ||
/// </summary> | ||
public abstract string Source { get; } | ||
|
||
/// <summary> | ||
/// Gets the binding data content | ||
/// </summary> | ||
public abstract BinaryData Content { get; } | ||
|
||
/// <summary> | ||
/// Gets the content type of the binding data content i.e. "application/json" | ||
/// </summary> | ||
public abstract string ContentType { get; } | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
// Copyright (c) .NET Foundation. All rights reserved. | ||
// Licensed under the MIT License. See License.txt in the project root for license information. | ||
|
||
using System; | ||
using System.Linq; | ||
|
||
namespace Microsoft.Azure.Functions.Worker.Grpc.Messages | ||
{ | ||
internal partial class GrpcCollectionModelBindingData : Microsoft.Azure.Functions.Worker.Core.CollectionModelBindingData | ||
{ | ||
public GrpcCollectionModelBindingData(CollectionModelBindingData modelBindingDataArray) | ||
{ | ||
ModelBindingDataArray = modelBindingDataArray.ModelBindingData | ||
.Select(p => new GrpcModelBindingData(p)).ToArray(); | ||
} | ||
|
||
public override Core.ModelBindingData[] ModelBindingDataArray { get; } | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
// 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.Grpc.Messages | ||
{ | ||
internal partial class GrpcModelBindingData : Microsoft.Azure.Functions.Worker.Core.ModelBindingData | ||
{ | ||
private readonly ModelBindingData _modelBindingData; | ||
|
||
public GrpcModelBindingData(ModelBindingData modelBindingData) | ||
{ | ||
_modelBindingData = modelBindingData; | ||
Content = BinaryData.FromBytes(_modelBindingData.Content.ToByteArray()); | ||
} | ||
|
||
public override string Version => _modelBindingData.Version; | ||
|
||
public override string Source => _modelBindingData.Source; | ||
|
||
public override BinaryData Content { get; } | ||
|
||
public override string ContentType => _modelBindingData.ContentType; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,9 @@ | ||
// Copyright (c) .NET Foundation. All rights reserved. | ||
// Licensed under the MIT License. See License.txt in the project root for license information. | ||
|
||
using System.Runtime.CompilerServices; | ||
using Xunit; | ||
|
||
[assembly: CollectionBehavior(DisableTestParallelization = true)] | ||
[assembly: InternalsVisibleTo("Microsoft.Azure.Functions.WorkerExtension.Tests, PublicKey=00240000048000009400000006020000002400005253413100040000010001005148be37ac1d9f58bd40a2e472c9d380d635b6048278f7d47480b08c928858f0f7fe17a6e4ce98da0e7a7f0b8c308aecd9e9b02d7e9680a5b5b75ac7773cec096fbbc64aebd429e77cb5f89a569a79b28e9c76426783f624b6b70327eb37341eb498a2c3918af97c4860db6cdca4732787150841e395a29cfacb959c1fd971c1")] | ||
|
24 changes: 24 additions & 0 deletions
24
test/Worker.Extensions.Tests/Worker.Extensions.Tests.csproj
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
|
||
<PropertyGroup> | ||
<TargetFramework>net7.0</TargetFramework> | ||
<IsPackable>false</IsPackable> | ||
<AssemblyName>Microsoft.Azure.Functions.Worker.Extensions.Tests</AssemblyName> | ||
<RootNamespace>Microsoft.Azure.Functions.Worker.Extensions.Tests</RootNamespace> | ||
<SignAssembly>true</SignAssembly> | ||
<LangVersion>preview</LangVersion> | ||
<AssemblyOriginatorKeyFile>..\..\key.snk</AssemblyOriginatorKeyFile> | ||
<Nullable>disable</Nullable> | ||
</PropertyGroup> | ||
|
||
<ItemGroup> | ||
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.6.3" /> | ||
<PackageReference Include="Moq" Version="4.18.2" /> | ||
<PackageReference Include="xunit" Version="2.4.2" /> | ||
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.5"> | ||
<PrivateAssets>all</PrivateAssets> | ||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets> | ||
</PackageReference> | ||
</ItemGroup> | ||
|
||
</Project> |