зеркало из https://github.com/aspnet/Routing.git
26 строки
761 B
C#
26 строки
761 B
C#
// 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 System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Threading.Tasks;
|
|
using Microsoft.AspNetCore.Builder;
|
|
using RoutingSample.Web.AuthorizationMiddleware;
|
|
|
|
namespace Microsoft.AspNetCore.Builder
|
|
{
|
|
public static class AuthorizationAppBuilderExtensions
|
|
{
|
|
public static IApplicationBuilder UseAuthorization(this IApplicationBuilder app)
|
|
{
|
|
if (app == null)
|
|
{
|
|
throw new ArgumentNullException(nameof(app));
|
|
}
|
|
|
|
return app.UseMiddleware<AuthorizationMiddleware>();
|
|
}
|
|
}
|
|
}
|