internal SanityMutationBuilder <TDoc> DeleteByQuery(Expression query) { var parser = new SanityExpressionParser(query, typeof(TDoc)); var sanityQuery = parser.BuildQuery(false); DeleteByQuery(sanityQuery); return(this); }
public SanityMutationBuilder <TDoc> DeleteByQuery(Expression <Func <TDoc, bool> > query) { var parser = new SanityExpressionParser(query, typeof(TDoc)); var sanityQuery = parser.BuildQuery(false); DeleteByQuery(sanityQuery); return(this); }
internal SanityMutationBuilder <TDoc> DeleteByQuery(Expression query) { var parser = new SanityExpressionParser(query, typeof(TDoc), MutationQuerySettings.MAX_NESTING_LEVEL); var sanityQuery = parser.BuildQuery(false); DeleteByQuery(sanityQuery); return(this); }
public SanityPatchByQuery(Expression query) : base() { if (query == null) { throw new ArgumentException("Query field must be set", nameof(query)); } var parser = new SanityExpressionParser(query, typeof(TDoc), MutationQuerySettings.MAX_NESTING_LEVEL); var sanityQuery = parser.BuildQuery(); Query = sanityQuery; }
public SanityPatchByQuery(Expression <Func <TDoc, bool> > query) : base() { if (query == null) { throw new ArgumentException("Query field must be set", nameof(query)); } var parser = new SanityExpressionParser(query, typeof(TDoc)); var sanityQuery = parser.BuildQuery(); Query = sanityQuery; }
//public SanityTransactionBuilder<TDoc> PatchByQuery(Expression<Func<TDoc, bool>> query, object patch) //{ // lock (GetLock()) // { // var sPatch = JsonConvert.SerializeObject(patch); // var oPatch = JsonConvert.DeserializeObject<SanityPatchByQuery<TDoc>>(sPatch); // var parser = new SanityExpressionParser(query, typeof(TDoc)); // var sQuery = parser.BuildQuery(); // oPatch.Query = sQuery; // InnerBuilder.Mutations.Add(new SanityPatchMutation(oPatch) { DocType = typeof(TDoc) }); // return this; // } //} public SanityMutationBuilder <TDoc> PatchByQuery(Expression <Func <TDoc, bool> > query, Action <SanityPatch> patch) { lock (GetLock()) { var oPatch = new SanityPatchByQuery <TDoc>(query); patch.Invoke(oPatch); var parser = new SanityExpressionParser(query, typeof(TDoc)); InnerBuilder.Mutations.Add(new SanityPatchMutation(oPatch) { DocType = typeof(TDoc) }); return(this); } }