Umbraco CMS
10.latest (LTS)
Ask or search…
K
Links

Data Persistence (CRUD)

The Umbraco Services layer is used to query and manipulate Umbraco stored in the database.

Dependency injection

All services are available using their interfaces in the dependency injection container. ASP.NET Core supports dependency injection in almost every scenario.

Constructors in classes

public class MyClass
{
private readonly IContentService _contentService;
public MyClass(IContentService contentService)
{
_contentService = contentService;
}
}

Constructors in views

@inject IContentService ContentService

Services

There is a service for each type of data in Umbraco.