C# Class 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.

Inheritance: Flatwhite.Hot.Phoenix
Afficher le fichier Open project: vanthoainguyen/Flatwhite Class Usage Examples

Méthodes publiques

Méthode Description
WebApiPhoenix ( _IInvocation invocation, WebApiCacheItem cacheItem, HttpRequestMessage originalRequestMessage ) : System

Initializes a WebApiPhoenix

Méthodes protégées

Méthode Description
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

Private Methods

Méthode Description
CloneRequestMessage ( HttpRequestMessage requestMessage ) : HttpRequestMessage
GetHttpClient ( ) : IHttpClient

Method Details

FireAsync() protected méthode

Send a http request with special header to loop back address to by pass the cache
protected FireAsync ( ) : Task
Résultat Task

GetTargetInstance() protected méthode

Not support in WebAPI
protected GetTargetInstance ( ICacheDependencyScope scope ) : object
scope ICacheDependencyScope
Résultat object

WebApiPhoenix() public méthode

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
Résultat System