Exemple #1
0
 public virtual async Task <object> GenerateAsync(ISessionImplementor session, object obj, CancellationToken cancellationToken)
 {
     cancellationToken.ThrowIfCancellationRequested();
     using (await _generate.LockAsync())
     {
         return(await(Optimizer.GenerateAsync(new TableAccessCallback(session, this), cancellationToken)).ConfigureAwait(false));
     }
 }
Exemple #2
0
 public virtual Task <object> GenerateAsync(ISessionImplementor session, object obj, CancellationToken cancellationToken)
 {
     if (cancellationToken.IsCancellationRequested)
     {
         return(Task.FromCanceled <object>(cancellationToken));
     }
     try
     {
         return(Optimizer.GenerateAsync(DatabaseStructure.BuildCallback(session), cancellationToken));
     }
     catch (System.Exception ex)
     {
         return(Task.FromException <object>(ex));
     }
 }