/
aprogrammer
/
reverse-proxy-ms-yarp
Обзор
Документация
Войти
/
aprogrammer
/
reverse-proxy-ms-yarp
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
src/ReverseProxy/Transforms/ResponseFuncTransform.cs
26 строк
677 B
Kahbazi
File Scoped Namespaces (#1352)
12 ноя 2021, 21:53
Не верифицирован
12 ноя 2021, 21:53
44f13d9
Код
Авторство
О чём код?
// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; using System.Threading.Tasks; namespace Yarp.ReverseProxy.Transforms; /// <summary> /// A response transform that runs the given Func. /// </summary> public class ResponseFuncTransform : ResponseTransform { private readonly Func<ResponseTransformContext, ValueTask> _func; public ResponseFuncTransform(Func<ResponseTransformContext, ValueTask> func) { _func = func ?? throw new ArgumentNullException(nameof(func)); } /// <inheritdoc/> public override ValueTask ApplyAsync(ResponseTransformContext context) { return _func(context); } }