Ejemplo n.º 1
0
 /// <summary>
 /// Adds an inner join to the query.
 /// The query that has been built up so far in the left hand side query builder may be converted to a subquery to capture more complex modifications, such as where clauses.
 /// </summary>
 /// <typeparam name="TRecordLeft">The record type of the left hand side query builder</typeparam>
 /// <typeparam name="TRecordRight">The record type of the right hand side query builder</typeparam>
 /// <param name="queryBuilder">The query builder which represents the left hand side of the join</param>
 /// <param name="rightHandQueryBuilder">The query builder which represents the right hand side of the join</param>
 /// <returns>The query builder that can be used to further modify the query, or execute the query</returns>
 public static IJoinSourceQueryBuilder <TRecordLeft> InnerJoin <TRecordLeft, TRecordRight>(this IQueryBuilder <TRecordLeft> queryBuilder,
                                                                                           ITableSourceQueryBuilder <TRecordRight> rightHandQueryBuilder)
     where TRecordLeft : class
     where TRecordRight : class
 {
     return(queryBuilder.Join(rightHandQueryBuilder.AsAliasedSource(), JoinType.InnerJoin, rightHandQueryBuilder.ParameterValues, rightHandQueryBuilder.Parameters, rightHandQueryBuilder.ParameterDefaults));
 }
 /// <summary>
 /// Adds a "NOLOCK" table hint to the table source of the query
 /// </summary>
 /// <typeparam name="TRecord">The record type of the query builder</typeparam>
 /// <param name="queryBuilder">The query builder</param>
 /// <returns>A plain SQL string representing a create stored procedure query</returns>
 public static IQueryBuilder <TRecord> NoLock <TRecord>(this ITableSourceQueryBuilder <TRecord> queryBuilder) where TRecord : class
 {
     return(queryBuilder.Hint("NOLOCK"));
 }