Class NovaRazorExternalApi
A proxy for a Noxum.Nova.Data.Cache.CachedExternalApi to be used in Razor Views
Inheritance
NovaRazorExternalApi
Assembly: Noxum.Nova.Razor.Model.dll
Syntax
public sealed class NovaRazorExternalApi : NovaRazorObject<CachedExternalApi>, IReadOnlyCollection<NovaRazorValue>, IEnumerable<NovaRazorValue>, IEnumerable
Methods
GetAsync(string)
Send a GET request to the external API. The JSON response will be deserialized to a dynamic object.
Declaration
public Task<ExpandoObject> GetAsync(string pathAndQuery)
Parameters
| Type |
Name |
Description |
| string |
pathAndQuery |
|
Returns
GetAsync<T>(string)
Send a GET request to the external API. The JSON response will be deserialized to a dynamic object.
Declaration
public Task<T> GetAsync<T>(string pathAndQuery) where T : class
Parameters
| Type |
Name |
Description |
| string |
pathAndQuery |
|
Returns
Type Parameters
PostAsync(string, object)
Post a dynamic object as JSON payload to the external API. The JSON response will be deserialized to a dynamic object.
Declaration
public Task<ExpandoObject> PostAsync(string path, object payload)
Parameters
Returns
PostAsync<T>(string, object)
Post a dynamic object as JSON payload to the external API. The JSON response will be deserialized to a dynamic object.
Declaration
public Task<T> PostAsync<T>(string path, object payload) where T : class
Parameters
Returns
Type Parameters
RenderAsync(string, string, object)
Send a GET request to the external API. The result will be returned as IHtmlContent so that it can be
output directly into a Razor page.
Declaration
public Task<IHtmlContent> RenderAsync(string pathAndQuery, string method = "Get", object payload = null)
Parameters
| Type |
Name |
Description |
| string |
pathAndQuery |
Path and Query of the request
|
| string |
method |
The method type ("Get" or "Post")
|
| object |
payload |
The payload the is posted as JSON
|
Returns
| Type |
Description |
| Task<IHtmlContent> |
HTML that can be rendered directly by Razor Views
|
Implements