Skip to content

Async versions

Jon P Smith edited this page Apr 11, 2018 · 2 revisions

Most of the examples use synchronous methods, but there is an ICrudServicesAsync which contains async versions of all of the commands.

NOTES:

  • The only command in both CrudServices and CrudServicesAsync that is synch/async agnostic is the ReadManyNoTracked. That method returns an IQueryable<T>, so you can add a synch (e.g. .ToList()) or an async (e.g. .ToListAsync()) on the end to define whether you want synch or async.
  • Only synchronous create/update methods are supported in the entity classes. If you are doing anything complex enough to be worth being async you should make it into business logic, which can be run async.