protected Task <int> WriteKeyAsync(DbCommand st, object id, int i, ISessionImplementor session, CancellationToken cancellationToken) { if (id == null) { throw new ArgumentNullException("id", "Null key for collection: " + role); } if (cancellationToken.IsCancellationRequested) { return(Task.FromCanceled <int>(cancellationToken)); } return(InternalWriteKeyAsync()); async Task <int> InternalWriteKeyAsync() { await(KeyType.NullSafeSetAsync(st, id, i, session, cancellationToken)).ConfigureAwait(false); return(i + keyColumnAliases.Length); } }