Ejemplo n.º 1
0
 /// <summary>
 /// Executes a query against the repository.
 /// </summary>
 protected virtual async Task Execute(Func <DisposableQueryFactory, Task> dbAction)
 {
     // TODO: add retry for transient errors.
     using (DisposableQueryFactory db = ConnectQuery()) {
         await dbAction(db);
     }
 }
Ejemplo n.º 2
0
 /// <summary>
 /// Executes a query against the repository,
 /// returning the expected result.
 /// </summary>
 protected virtual async Task <TResult> Execute <TResult>(Func <DisposableQueryFactory, Task <TResult> > dbAction)
 {
     // TODO: add retry for transient errors.
     using (DisposableQueryFactory db = ConnectQuery()) {
         return(await dbAction(db));
     }
 }