Class EditorService
Provides functionality to replace the media URLs (images and documents) in a given text with the corresponding URLs for the specified routes.
Implements
Inherited Members
Namespace: DataWeb.Media
Assembly: DataWeb.Core.dll
Syntax
public class EditorService : IEditorService
Remarks
Provides a service for setting media URLs in text.
Constructors
EditorService(LinkGenerator)
Provides functionality to replace the media URLs (images and documents) in a given text with the corresponding URLs for the specified routes.
Declaration
public EditorService(LinkGenerator linkGenerator)
Parameters
| Type | Name | Description |
|---|---|---|
| LinkGenerator | linkGenerator | The LinkGenerator to use for generating URLs. |
Remarks
Provides a service for setting media URLs in text.
Methods
SetMediaUrls(string, MediaRoute, MediaRoute)
Replaces the media URLs (images and documents) in a given text with the corresponding URLs for the specified routes.
Declaration
public string SetMediaUrls(string text, MediaRoute imageRoute = null, MediaRoute documentRoute = null)
Parameters
| Type | Name | Description |
|---|---|---|
| string | text | The text to replace the media URLs in. |
| MediaRoute | imageRoute | The MediaRoute to use for images. |
| MediaRoute | documentRoute | The MediaRoute to use for documents. |
Returns
| Type | Description |
|---|---|
| string | The text with the media URLs replaced. |
SetMediaUrls(string, string, string)
Replaces the media URLs (images and documents) in a given text with the corresponding URLs for the specified routes.
Declaration
public string SetMediaUrls(string text, string imageRouteName = null, string documentRouteName = null)
Parameters
| Type | Name | Description |
|---|---|---|
| string | text | The text to replace the media URLs in. |
| string | imageRouteName | The name of the route to use for images. |
| string | documentRouteName | The name of the route to use for documents. |
Returns
| Type | Description |
|---|---|
| string | The text with the media URLs replaced. |