C# Класс Flatwhite.WebApi.WebApiPhoenix

A web api phoenix to support auto refresh for webApi

It will create instance of WebApi controller and invoke the ActionMethod with cached arguments. It will not work if the controller required QueryString, Headers or anything outside these action method parameters But you can override the Phoenix MethodInfo, Arguments or method Phoenix.GetTargetInstance, Phoenix.InvokeAndGetBareResult, or completely change the way the Phoenix reborn by overriding method , Phoenix.Reborn, Idealy, keep Controller thin and use proper Model binding instead of dodgy access the Request object.

Наследование: Flatwhite.Hot.Phoenix
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
WebApiPhoenix ( _IInvocation invocation, WebApiCacheItem cacheItem, HttpRequestMessage originalRequestMessage ) : System

Initializes a WebApiPhoenix

Защищенные методы

Метод Описание
FireAsync ( ) : Task

Send a http request with special header to loop back address to by pass the cache

GetTargetInstance ( ICacheDependencyScope scope ) : object

Not support in WebAPI

Приватные методы

Метод Описание
CloneRequestMessage ( HttpRequestMessage requestMessage ) : HttpRequestMessage
GetHttpClient ( ) : IHttpClient

Описание методов

FireAsync() защищенный Метод

Send a http request with special header to loop back address to by pass the cache
protected FireAsync ( ) : Task
Результат Task

GetTargetInstance() защищенный Метод

Not support in WebAPI
protected GetTargetInstance ( ICacheDependencyScope scope ) : object
scope ICacheDependencyScope
Результат object

WebApiPhoenix() публичный Метод

Initializes a WebApiPhoenix
public WebApiPhoenix ( _IInvocation invocation, WebApiCacheItem cacheItem, HttpRequestMessage originalRequestMessage ) : System
invocation _IInvocation
cacheItem WebApiCacheItem This should the the WebApiCacheItem instance
originalRequestMessage System.Net.Http.HttpRequestMessage
Результат System