We have moved!

You are currently looking at documentation for Umbraco 8 and older versions.
An automated guess is that docs.umbraco.com/umbraco-cms/implementation/data-persistence/ could be the link to the new documentation for Umbraco 9 and newer versions.

    Data Persistence (CRUD) in Umbraco

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

    Service Context

    The ServiceContext is the gateway to all of Umbraco's core services. In most cases, the ServiceContext will be exposed as a property on all Umbraco base classes such as SurfaceControllers, UmbracoApiControllers, any Umbraco views, etc... So for the majority of cases, you can access the services by using this code (for example):

    Services.ContentService.GetById(123);
    

    If you are not working with an Umbraco base class and the ServiceContext is not exposed, you can reference the static Current class directly:

    Umbraco.Core.Composing.Current.Services.ContentService.GetById(123);
    

    Services

    There are a few different services exposed on the ServiceContext such as: ContentService, MediaService, MemberService, etc... There is a service for each type of data in Umbraco.

    See here For a full list of services available