Skip to content

Commit c406fc9

Browse files
committed
Change name of AddObject's second parameter from "whitelist" to includedProperties.
1 parent aa8a364 commit c406fc9

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

RestSharp/IRestRequest.cs

+3-3
Original file line numberDiff line numberDiff line change
@@ -175,15 +175,15 @@ public interface IRestRequest
175175
IRestRequest AddBody (object obj);
176176

177177
/// <summary>
178-
/// Calls AddParameter() for all public, readable properties specified in the white list
178+
/// Calls AddParameter() for all public, readable properties specified in the includedProperties list
179179
/// </summary>
180180
/// <example>
181181
/// request.AddObject(product, "ProductId", "Price", ...);
182182
/// </example>
183183
/// <param name="obj">The object with properties to add as parameters</param>
184-
/// <param name="whitelist">The names of the properties to include</param>
184+
/// <param name="includedProperties">The names of the properties to include</param>
185185
/// <returns>This request</returns>
186-
IRestRequest AddObject (object obj, params string[] whitelist);
186+
IRestRequest AddObject (object obj, string[] includedProperties);
187187

188188
/// <summary>
189189
/// Calls AddParameter() for all public, readable properties of obj

RestSharp/RestRequest.cs

+4-4
Original file line numberDiff line numberDiff line change
@@ -252,23 +252,23 @@ public IRestRequest AddBody (object obj)
252252
}
253253

254254
/// <summary>
255-
/// Calls AddParameter() for all public, readable properties specified in the white list
255+
/// Calls AddParameter() for all public, readable properties specified in the includedProperties list
256256
/// </summary>
257257
/// <example>
258258
/// request.AddObject(product, "ProductId", "Price", ...);
259259
/// </example>
260260
/// <param name="obj">The object with properties to add as parameters</param>
261-
/// <param name="whitelist">The names of the properties to include</param>
261+
/// <param name="includedProperties">The names of the properties to include</param>
262262
/// <returns>This request</returns>
263-
public IRestRequest AddObject (object obj, params string[] whitelist)
263+
public IRestRequest AddObject (object obj, string[] includedProperties)
264264
{
265265
// automatically create parameters from object props
266266
var type = obj.GetType();
267267
var props = type.GetProperties();
268268

269269
foreach (var prop in props)
270270
{
271-
bool isAllowed = whitelist.Length == 0 || (whitelist.Length > 0 && whitelist.Contains(prop.Name));
271+
bool isAllowed = includedProperties.Length == 0 || (includedProperties.Length > 0 && includedProperties.Contains(prop.Name));
272272

273273
if (isAllowed)
274274
{

0 commit comments

Comments
 (0)