Skip to content

Commit 5545269

Browse files
authored
Api updates (#262)
1 parent 19e4121 commit 5545269

20 files changed

+93
-48
lines changed

samples/FunctionApp/Program.cs

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,7 @@
11
// Copyright (c) .NET Foundation. All rights reserved.
22
// Licensed under the MIT License. See License.txt in the project root for license information.
33

4-
using System.Diagnostics;
54
using System.Threading.Tasks;
6-
using Microsoft.Azure.Functions.Worker.Configuration;
7-
using Microsoft.Extensions.Configuration;
85
using Microsoft.Extensions.DependencyInjection;
96
using Microsoft.Extensions.Hosting;
107

@@ -19,12 +16,6 @@ static async Task Main(string[] args)
1916
// #endif
2017
//<docsnippet_startup>
2118
var host = new HostBuilder()
22-
//<docsnippet_configure_app>
23-
.ConfigureAppConfiguration(c =>
24-
{
25-
c.AddCommandLine(args);
26-
})
27-
//</docsnippet_configure_app>
2819
//<docsnippet_middleware>
2920
.ConfigureFunctionsWorkerDefaults()
3021
//</docsnippet_middleware>

src/DotNetWorker.Core/Context/BindingContext.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
namespace Microsoft.Azure.Functions.Worker
77
{
88
/// <summary>
9-
/// Exposes binding infomation for a given funcion context.
9+
/// Exposes binding infomation for a given function context.
1010
/// </summary>
1111
public abstract class BindingContext
1212
{

src/DotNetWorker.Core/Context/DefaultFunctionContext.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ public DefaultFunctionContext(IServiceScopeFactory serviceScopeFactory, IInvocat
2626
}
2727

2828

29-
public override string Id => _invocation.Id;
29+
public override string InvocationId => _invocation.Id;
3030

3131
public override string FunctionId => _invocation.FunctionId;
3232

src/DotNetWorker.Core/Context/FunctionContext.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ public abstract class FunctionContext
1515
/// Gets the invocation ID.
1616
/// This identifier is unique to an invocation.
1717
/// </summary>
18-
public abstract string Id { get; }
18+
public abstract string InvocationId { get; }
1919

2020
/// <summary>
2121
/// Gets the function ID, typically assigned by the host.
@@ -30,6 +30,7 @@ public abstract class FunctionContext
3030

3131
/// <summary>
3232
/// Gets the binding context for the current function invocation.
33+
/// This context is used to retrieve binding data.
3334
/// </summary>
3435
public abstract BindingContext BindingContext { get; }
3536

src/DotNetWorker.Core/FunctionsApplication.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
using System.Collections.Concurrent;
66
using System.Threading.Tasks;
77
using Microsoft.Azure.Functions.Worker.Diagnostics;
8+
using Microsoft.Azure.Functions.Worker.Middleware;
89
using Microsoft.Azure.Functions.Worker.Pipeline;
910
using Microsoft.Extensions.Logging;
1011
using Microsoft.Extensions.Options;
@@ -57,7 +58,7 @@ public void LoadFunction(FunctionDefinition definition)
5758

5859
public Task InvokeFunctionAsync(FunctionContext context)
5960
{
60-
var scope = new FunctionInvocationScope(context.FunctionDefinition.Name, context.Id);
61+
var scope = new FunctionInvocationScope(context.FunctionDefinition.Name, context.InvocationId);
6162
using (_logger.BeginScope(scope))
6263
{
6364
return _functionExecutionDelegate(context);

src/DotNetWorker.Core/Hosting/FunctionsWorkerApplicationBuilder.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
1-
// Copyright (c) .NET Foundation. All rights reserved.
1+
// Copyright (c) .NET Foundation. All rights reserved.
22
// Licensed under the MIT License. See License.txt in the project root for license information.
33

44
using System;
5+
using Microsoft.Azure.Functions.Worker.Middleware;
56
using Microsoft.Azure.Functions.Worker.Pipeline;
67
using Microsoft.Extensions.DependencyInjection;
78

src/DotNetWorker.Core/Hosting/IFunctionsWorkerApplicationBuilder.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// Licensed under the MIT License. See License.txt in the project root for license information.
33

44
using System;
5-
using Microsoft.Azure.Functions.Worker.Pipeline;
5+
using Microsoft.Azure.Functions.Worker.Middleware;
66
using Microsoft.Extensions.DependencyInjection;
77

88
namespace Microsoft.Azure.Functions.Worker

src/DotNetWorker.Core/Hosting/WorkerMiddlewareWorkerApplicationBuilderExtensions.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
// Licensed under the MIT License. See License.txt in the project root for license information.
33

44
using System.Linq;
5-
using System.Reflection;
65
using Microsoft.Azure.Functions.Worker;
76
using Microsoft.Azure.Functions.Worker.Middleware;
87
using Microsoft.Azure.Functions.Worker.OutputBindings;
@@ -14,7 +13,7 @@ namespace Microsoft.Extensions.Hosting
1413
/// <summary>
1514
/// Provides extension methods to work with Worker Middleware against a <see cref="IHostBuilder"/>.
1615
/// </summary>
17-
public static class WorkerMiddlewareWorkerApplicationBuilderExtensions
16+
public static class MiddlewareWorkerApplicationBuilderExtensions
1817
{
1918
/// <summary>
2019
/// Configures the <see cref="IFunctionsWorkerApplicationBuilder"/> to use the default set of middleware used by the worker, in the following order:

src/DotNetWorker.Core/Invocation/DefaultFunctionExecutor.Log.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ private static class Log
1717

1818
public static void ModelBindingFeatureUnavailable(ILogger<DefaultFunctionExecutor> logger, FunctionContext context)
1919
{
20-
_modelBindingFeatureUnavailable(logger, context.Id, context.FunctionId, null);
20+
_modelBindingFeatureUnavailable(logger, context.InvocationId, context.FunctionId, null);
2121
}
2222
}
2323
}

src/DotNetWorker.Core/OutputBindings/OutputBindingsMiddleware.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// Licensed under the MIT License. See License.txt in the project root for license information.
33

44
using System.Threading.Tasks;
5-
using Microsoft.Azure.Functions.Worker.Pipeline;
5+
using Microsoft.Azure.Functions.Worker.Middleware;
66

77
namespace Microsoft.Azure.Functions.Worker.OutputBindings
88
{

0 commit comments

Comments
 (0)