/// <summary> /// Clones this clause. /// </summary> /// <param name="cloneContext">The clones of all query source clauses are registered with this <see cref="CloneContext"/>.</param> /// <returns>A clone of this clause.</returns> public UpsertAndReturnClause Clone(CloneContext cloneContext) { Utils.CheckNotNull("cloneContext", cloneContext); var result = new UpsertAndReturnClause(SearchSelector, InsertSelector, UpdateSelector, ItemName, CollectionType); return(result); }
public void VisitUpsertAndReturnClause(UpsertAndReturnClause upsertAndReturnClause, QueryModel queryModel) { QueryText.Append(" upsert "); GetAqlExpression(upsertAndReturnClause.SearchSelector, queryModel); QueryText.Append(" insert "); GetAqlExpression(upsertAndReturnClause.InsertSelector, queryModel); QueryText.Append(" update "); GetAqlExpression(upsertAndReturnClause.UpdateSelector, queryModel); CrudState.ModelVisitorHaveCrudOperation = true; CrudState.Collection = LinqUtility.ResolveCollectionName(Db, upsertAndReturnClause.CollectionType); CrudState.ReturnResult = upsertAndReturnClause.ReturnResult; CrudState.ReturnResultKind = "NEW"; }
/// <summary> /// Clones this clause. /// </summary> /// <param name="cloneContext">The clones of all query source clauses are registered with this <see cref="CloneContext"/>.</param> /// <returns>A clone of this clause.</returns> public UpsertAndReturnClause Clone(CloneContext cloneContext) { Utils.CheckNotNull("cloneContext", cloneContext); var result = new UpsertAndReturnClause(SearchSelector,InsertSelector,UpdateSelector, ItemName, CollectionType); return result; }