Async APIs
Learn about Async API Changes
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
Asyncsuffix.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 = defaultas the last parameter.
Deprecation Timeline
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>):
Implement all new
*ImplAsyncabstract methods.Migrate callers from sync to async methods.
Pass
CancellationTokenthrough the call chain.The sync
*Implmethods still work but will be removed in version 19.
// 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);
}Last updated
Was this helpful?