Class SyndicationFeedHttpContentConverter
This can convert HttpContent from/to a SyndicationFeed
Inheritance
Implements
Inherited Members
Namespace: Dapplo.HttpExtensions.ContentConverter
Assembly: Dapplo.HttpExtensions.dll
Syntax
public class SyndicationFeedHttpContentConverter : IHttpContentConverter
Properties
| Improve this Doc View SourceInstance
Instance of this IHttpContentConverter for reusing
Declaration
public static Lazy<SyndicationFeedHttpContentConverter> Instance { get; }
Property Value
| Type | Description |
|---|---|
| Lazy<SyndicationFeedHttpContentConverter> |
Order
Specify the order in that this IHttpContentConverter is used
Declaration
public int Order { get; }
Property Value
| Type | Description |
|---|---|
| System.Int32 |
Methods
| Improve this Doc View SourceAddAcceptHeadersForType(Type, HttpRequestMessage)
Add Accept-Headers to the HttpRequestMessage, depending on the passt resultType. This tries to hint the Http server what we can accept, which depends on the type of the return value
Declaration
public void AddAcceptHeadersForType(Type resultType, HttpRequestMessage httpRequestMessage)
Parameters
| Type | Name | Description |
|---|---|---|
| Type | resultType | Result type, this where to a conversion from HttpContent is made |
| HttpRequestMessage | httpRequestMessage | HttpRequestMessage |
CanConvertFromHttpContent(Type, HttpContent)
Check if this IHttpContentProcessor can convert the HttpContent into the specified type
Declaration
public bool CanConvertFromHttpContent(Type typeToConvertTo, HttpContent httpContent)
Parameters
| Type | Name | Description |
|---|---|---|
| Type | typeToConvertTo | Type from which a conversion should be made |
| HttpContent | httpContent | HttpContent object to process |
Returns
| Type | Description |
|---|---|
| System.Boolean | true if this processor can do the conversion |
CanConvertToHttpContent(Type, Object)
Check if this IHttpContentProcessor can convert the specified type to a HttpContent
Declaration
public bool CanConvertToHttpContent(Type typeToConvert, object content)
Parameters
| Type | Name | Description |
|---|---|---|
| Type | typeToConvert | |
| System.Object | content | Content to place into a HttpContent |
Returns
| Type | Description |
|---|---|
| System.Boolean | true if this processor can do the conversion |
ConvertFromHttpContentAsync(Type, HttpContent, CancellationToken)
Create the target object from the supplied HttpContent
Declaration
public async Task<object> ConvertFromHttpContentAsync(Type resultType, HttpContent httpContent, CancellationToken cancellationToken = null)
Parameters
| Type | Name | Description |
|---|---|---|
| Type | resultType | Typ to process the HttpContent to |
| HttpContent | httpContent | HttpContent |
| CancellationToken | cancellationToken | CancellationToken |
Returns
| Type | Description |
|---|---|
| Task<System.Object> | object of type resultType |
ConvertToHttpContent(Type, Object)
Create HttpContent for the supplied object/type
Declaration
public HttpContent ConvertToHttpContent(Type typeToConvert, object content)
Parameters
| Type | Name | Description |
|---|---|---|
| Type | typeToConvert | Type of the content to convert |
| System.Object | content | Content to place into a HttpContent |
Returns
| Type | Description |
|---|---|
| HttpContent | HttpContent |