# Async APIs

UI Builder `17.1.0` adds EF Core support, converting the data access pipeline to async-first. This update impacts API controllers, services, repositories, and database extensions. Existing sync methods are now obsolete and scheduled for removal in V19.

This migration handled the following:

* Every existing sync method gets an async counterpart with an `Async` suffix.
* Sync methods are marked `[Obsolete("Scheduled for removal in v19")]`.
* Sync methods are rewired to delegate to async via `.ConfigureAwait(false).GetAwaiter().GetResult()`.
* All async methods accept an optional `CancellationToken cancellationToken = default` as the last parameter.

## Deprecation Timeline

| Version        | Status                                                 |
| -------------- | ------------------------------------------------------ |
| **Version 17** | Sync methods marked `[Obsolete]`, async methods added. |
| **Version 19** | Sync methods removed.                                  |

## Migration Guide for Custom Repository Implementations

If you have a custom repository extending `Repository<TEntity, TId>` (or use the new `EFCoreRepository<TEntity, TId>`):

1. Implement all new `*ImplAsync` abstract methods.
2. Migrate callers from sync to async methods.
3. Pass `CancellationToken` through the call chain.
4. The sync `*Impl` methods still work but will be removed in version 19.

```csharp
// Before (v16)
protected override TEntity GetImpl(TId id)
{
    return _myDataSource.Get(id);
}

// After (v17+)
protected override async Task<TEntity> GetImplAsync(TId id, CancellationToken cancellationToken)
{
    return await _myDataSource.GetAsync(id, cancellationToken);
}
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.umbraco.com/umbraco-ui-builder/advanced/async-apis.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
