/// <summary> /// Delete the specified employee. /// </summary> /// <param name="code">The code to consider.</param> /// <returns>Returns the generated query.</returns> internal IDbQuery DeleteEmployee3(string code) { var query = DbFluent.DeleteQuery(Table <DbEmployee>()) .Where(q => DataExpressionFactory.CreateExpAsAuto("{{" + string.Format("$sqlEq($sqlField('Code'), {0})", q.UseParameter("code", DataValueTypes.Text).AsExp()) + "}}")) .WithParameters( ElementFactory.CreateScalar("code", code)); return(query); }
/// <summary> /// Delete the specified employee. /// </summary> /// <param name="code">The code to consider.</param> /// <returns>Returns the generated query.</returns> internal IDbQuery DeleteEmployee7(string code) { var query = DbFluent.DeleteQuery(Table <DbEmployee>()) .From( TableAsJoin <DbContact>( DbQueryJoinKind.Left, JoinCondition <DbEmployee, DbContact>()) .WithAlias("mainCountry")) .Where(q => DataExpressionFactory.CreateExpAsAuto("{{" + string.Format("$sqlEq($sqlField('Code'), {0})", q.UseParameter("code", DataValueTypes.Text).AsExp()) + "}}")) .WithParameters( ElementFactory.CreateScalar("code", code)); return(query); }
/// <summary> /// Delete the specified employee. /// </summary> /// <param name="code">The code to consider.</param> /// <returns>Returns the generated query.</returns> internal IDbQuery DeleteEmployee8(string code) { var query = DeleteQuery <DbEmployee>() .From( DbFluent.TableAsJoin(DbQueryJoinKind.Left, Table("RegionalDirectorate").WithAlias("directorate"), JoinCondition("Employee_RegionalDirectorate")), TableAsJoin <DbContact>(DbQueryJoinKind.Left, JoinCondition <DbEmployee, DbContact>()) .WithAlias("mainCountry"), DbFluent.TableAsJoin( DbQueryJoinKind.Left, Table <DbContact>().WithAlias("secondaryCountry"), JoinCondition <DbEmployee, DbContact>("secondary"))) .Where(q => DataExpressionFactory.CreateExpAsLiteral(@"""Code""='codeC'")) .WithParameters( ElementFactory.CreateScalar("code", code)); return(query); }