public static MutateInSpecBuilder Upsert <T>(this MutateInSpecBuilder builder, string path, T value, Action <MutateInUpsertOptions> configureOptions) { var options = new MutateInUpsertOptions(); configureOptions?.Invoke(options); return(builder.Upsert(path, value, options.CreatePath, options.XAttr)); }
public static MutateInSpecBuilder <TDocument> Upsert <TDocument, TContent>(this MutateInSpecBuilder <TDocument> builder, Expression <Func <TDocument, TContent> > path, TContent value, bool createPath = false) { // ReSharper disable ConditionIsAlwaysTrueOrFalse if (builder == null) { ThrowHelper.ThrowArgumentNullException(nameof(builder)); } if (path == null) { ThrowHelper.ThrowArgumentNullException(nameof(path)); } // ReSharper restore ConditionIsAlwaysTrueOrFalse return((MutateInSpecBuilder <TDocument>) builder.Upsert(SubDocumentPathExpressionVisitor.GetPath(builder, path), value, createPath)); }