IInclude <T> IIncludeSession.Single <T>(SqlQuery sqlQuery) { if (sqlQuery == null) { throw new ArgumentNullException("sqlQuery"); } var include = new IncludeSingle <T>(); this.includes.Enqueue(include); this.queries.Enqueue(sqlQuery); return(include); }
public async Task <T> SingleAsync <T>(SqlQuery sqlQuery, CancellationToken cancellationToken) { this.ThrowIfDisposed(); if (sqlQuery == null) { throw new ArgumentNullException("sqlQuery"); } var include = new IncludeSingle <T>(); this.includes.Enqueue(include); this.queries.Enqueue(sqlQuery); await this.ExecutePendingQueriesAsync(cancellationToken).ConfigureAwait(false); return(include.Value); }
public T Single <T>(SqlQuery sqlQuery) { this.ThrowIfDisposed(); if (sqlQuery == null) { throw new ArgumentNullException("sqlQuery"); } var include = new IncludeSingle <T>(); this.includes.Enqueue(include); this.queries.Enqueue(sqlQuery); this.ExecutePendingQueries(); return(include.Value); }