/// <summary> /// Instructs the builder to use the specified synonym for a query in the relational code. /// </summary> /// <typeparam name="T">The type of a synonym node.</typeparam> /// <param name="prev">A SQL query.</param> /// <param name="synonym">A synonym of a query.</param> public static DbTable <T> UseAs <T>(this IEndView prev, DbTable <T> synonym) where T : DbRow { prev.CheckNullAndThrow("prev", Text.Method.UseAs); synonym.CheckNullAndThrow("synonym", Text.Method.UseAs); CheckSynonymAndThrow(synonym); if (((Chainer)prev).GetRoot().Statements.Count > 1) { throw new QueryTalkException(".UseAs", QueryTalkExceptionType.InvalidSynonym, null, Text.Method.UseAs); } ((DbNode)(object)synonym).SynonymQuery = (Chainer)prev; return(synonym); }
/// <summary> /// Ends the view design and creates the View object. /// </summary> /// <param name="prev">A predecessor object.</param> public static View EndView(this IEndView prev) { return(new View((Chainer)prev)); }