A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://docs.umbraco.com/umbraco-cms/13.latest/reference/management/services/macroservice below:

MacroService | Umbraco CMS

MacroService | Umbraco CMS
  1. Reference
  2. Management
  3. Services Reference
MacroService

MacrosService will be removed in the next version.

Defines the MacroService, which is an access to operations involving IMacro.

Browse the API documentation for IMacroService interface .

All samples in this document will require references to the following dll:

using Umbraco.Cms.Core.Services;

For Razor views:

@using Umbraco.Cms.Core.Services

If you wish to use the macro service in a class, you need to specify the IMacroService interface in your constructor:

public class MyClass
{
    private IMacroService _macroService;

    public MyClass(IMacroService macroService)
    {
        _macroService = macroService;
    }
}

In Razor views, you can access the macro service through the @inject directive:

@inject IMacroService MacroService

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4