Skip to content
This repository was archived by the owner on Dec 14, 2018. It is now read-only.

Commit

Permalink
Fix #4929 - Move IActionInvokerFactory from .Internal
Browse files Browse the repository at this point in the history
Also added a wealth of doc comments to an area that's not currently super
well documented.
  • Loading branch information
rynowak committed Jul 1, 2016
1 parent 42cea41 commit 0823889
Show file tree
Hide file tree
Showing 4 changed files with 68 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,19 @@

namespace Microsoft.AspNetCore.Mvc.Abstractions
{
/// <summary>
/// Defines an interface for invoking an MVC action.
/// </summary>
/// <remarks>
/// An <see cref="IActionInvoker"/> is created for each request the MVC handles by querying the set of
/// <see cref="IActionInvokerProvider"/> instances. See <see cref="IActionInvokerProvider"/> for more information.
/// </remarks>
public interface IActionInvoker
{
/// <summary>
/// Invokes an MVC action.
/// </summary>
/// <returns>A <see cref="Task"/> which will complete when action processing has completed.</returns>
Task InvokeAsync();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,27 @@

namespace Microsoft.AspNetCore.Mvc.Abstractions
{
/// <summary>
/// Defines an interface for components that can create an <see cref="IActionInvoker"/> for the
/// current request.
/// </summary>
/// <remarks>
/// <para>
/// <see cref="IActionInvokerProvider"/> instances form a pipeline that results in the creation of an
/// <see cref="IActionInvoker"/>. The <see cref="IActionInvokerProvider"/> instances are ordered by
/// an ascending sort of the <see cref="Order"/>.
/// </para>
/// <para>
/// To create an <see cref="IActionInvoker"/>, each provider has its <see cref="OnProvidersExecuting"/> method
/// called in sequence and given the same instance of <see cref="ActionInvokerProviderContext"/>. Then each
/// provider has its <see cref="OnProvidersExecuted"/> method called in the reverse order. The result is
/// the value of <see cref="ActionInvokerProviderContext.Result"/>.
/// </para>
/// <para>
/// As providers are called in a predefined sequence, each provider has a chance to observe and decorate the
/// result of the providers that have already run.
/// </para>
/// </remarks>
public interface IActionInvokerProvider
{
/// <summary>
Expand All @@ -26,8 +47,16 @@ public interface IActionInvokerProvider
/// </remarks>
int Order { get; }

/// <summary>
/// Called to execute the provider.
/// </summary>
/// <param name="context">The <see cref="ActionInvokerProviderContext"/>.</param>
void OnProvidersExecuting(ActionInvokerProviderContext context);

/// <summary>
/// Called to execute the provider, after all <see cref="OnProvidersExecuting"/> methods have been called.
/// </summary>
/// <param name="context">The <see cref="ActionInvokerProviderContext"/>.</param>
void OnProvidersExecuted(ActionInvokerProviderContext context);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
// Copyright (c) .NET Foundation. All rights reserved.
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.

using Microsoft.AspNetCore.Mvc.Abstractions;

namespace Microsoft.AspNetCore.Mvc.Infrastructure
{
/// <summary>
/// Defines an interface for creating an <see cref="IActionInvoker"/> for the current request.
/// </summary>
/// <remarks>
/// The default <see cref="IActionInvokerFactory"/> implementation creates an <see cref="IActionInvoker"/> by
/// calling into each <see cref="IActionInvokerProvider"/>. See <see cref="IActionInvokerProvider"/> for more
/// details.
/// </remarks>
public interface IActionInvokerFactory
{
/// <summary>
/// Creates an <see cref="IActionInvoker"/> for the current request associated with
/// <paramref name="actionContext"/>.
/// </summary>
/// <param name="actionContext">
/// The <see cref="ActionContext"/> associated with the current request.
/// </param>
/// <returns>An <see cref="IActionInvoker"/> or <c>null</c>.</returns>
IActionInvoker CreateInvoker(ActionContext actionContext);
}
}

This file was deleted.

0 comments on commit 0823889

Please sign in to comment.