Example #1
0
        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);
        }
Example #2
0
        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);
        }
Example #3
0
        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);
        }