Class MimeTypeCustomizerExtensions
Provides extension methods for types implementing IMimeTypeCustomizer.
Inherited Members
Namespace: EmbedIO
Syntax
public static class MimeTypeCustomizerExtensions
Methods
PreferCompressionFor<T>(T, String)
Indicates that compression should be preferred when negotiating content encoding for a response with the specified content type, or whose content type is in the specified media range.
Declaration
public static T PreferCompressionFor<T>(this T this, string mimeType)
where T : IMimeTypeCustomizer
Parameters
Type | Name | Description |
---|---|---|
T | this | The object to which this method is applied. |
String | mimeType | The MIME type or media range. |
Returns
Type | Description |
---|---|
T |
|
Type Parameters
Name | Description |
---|---|
T | The type of the object to which this method is applied. |
PreferCompressionFor<T>(T, String, Boolean)
Indicates whether to prefer compression when negotiating content encoding for a response with the specified content type, or whose content type is in the specified media range.
Declaration
public static T PreferCompressionFor<T>(this T this, string mimeType, bool preferCompression)
where T : IMimeTypeCustomizer
Parameters
Type | Name | Description |
---|---|---|
T | this | The object to which this method is applied. |
String | mimeType | The MIME type or media range. |
Boolean | preferCompression | true to prefer compression; otherwise, false. |
Returns
Type | Description |
---|---|
T |
|
Type Parameters
Name | Description |
---|---|
T | The type of the object to which this method is applied. |
PreferNoCompressionFor<T>(T, String)
Indicates that no compression should be preferred when negotiating content encoding for a response with the specified content type, or whose content type is in the specified media range.
Declaration
public static T PreferNoCompressionFor<T>(this T this, string mimeType)
where T : IMimeTypeCustomizer
Parameters
Type | Name | Description |
---|---|---|
T | this | The object to which this method is applied. |
String | mimeType | The MIME type or media range. |
Returns
Type | Description |
---|---|
T |
|
Type Parameters
Name | Description |
---|---|
T | The type of the object to which this method is applied. |
WithCustomMimeType<T>(T, String, String)
Adds a custom association between a file extension and a MIME type.
Declaration
public static T WithCustomMimeType<T>(this T this, string extension, string mimeType)
where T : IMimeTypeCustomizer
Parameters
Type | Name | Description |
---|---|---|
T | this | The object to which this method is applied. |
String | extension | The file extension to associate to |
String | mimeType | The MIME type to associate to |
Returns
Type | Description |
---|---|
T |
|
Type Parameters
Name | Description |
---|---|
T | The type of the object to which this method is applied. |