예제 #1
0
 protected internal override Task <object> GetResultAsync(ISessionImplementor session, DbDataReader rs, object obj, CancellationToken cancellationToken)
 {
     if (cancellationToken.IsCancellationRequested)
     {
         return(Task.FromCanceled <object>(cancellationToken));
     }
     return(IdentifierGeneratorFactory.GetGeneratedIdentityAsync(rs, persister.IdentifierType, session, cancellationToken));
 }
예제 #2
0
            public override async Task <object> ExecuteAndExtractAsync(DbCommand insert, ISessionImplementor session, CancellationToken cancellationToken)
            {
                cancellationToken.ThrowIfCancellationRequested();
                var rs = await(session.Batcher.ExecuteReaderAsync(insert, cancellationToken)).ConfigureAwait(false);

                try
                {
                    return(await(IdentifierGeneratorFactory.GetGeneratedIdentityAsync(rs, persister.IdentifierType, session, cancellationToken)).ConfigureAwait(false));
                }
                finally
                {
                    session.Batcher.CloseReader(rs);
                }
            }