Skip to content

Commit b0b9173

Browse files
committed
Add Params() overload that takes a FluentDictionary
1 parent 967e6ed commit b0b9173

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

src/Nest/DSL/SearchTemplateDescriptor.cs

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -126,9 +126,17 @@ public SearchTemplateDescriptor<T> Template(Func<TemplateDescriptor, TemplateDes
126126
return this;
127127
}
128128

129-
public SearchTemplateDescriptor<T> Params(IDictionary<string, object> parameters)
129+
public SearchTemplateDescriptor<T> Params(Dictionary<string, object> paramDictionary)
130130
{
131-
this.Self.Params = parameters;
131+
paramDictionary.ThrowIfNull("paramDictionary");
132+
this.Self.Params = paramDictionary;
133+
return this;
134+
}
135+
136+
public SearchTemplateDescriptor<T> Params(Func<FluentDictionary<string, object>, FluentDictionary<string, object>> paramDictionary)
137+
{
138+
paramDictionary.ThrowIfNull("paramDictionary");
139+
this.Self.Params = paramDictionary(new FluentDictionary<string, object>());
132140
return this;
133141
}
134142

0 commit comments

Comments
 (0)