simplify Put;

This commit is contained in:
2013-06-24 20:02:01 +02:00
parent 3470c7bb80
commit 316db90df3
3 changed files with 33 additions and 9 deletions
+21 -4
View File
@@ -133,7 +133,7 @@ namespace PocketSharp
/// <summary>
/// Fetches/Updates a typed resource
/// Fetches a typed resource
/// </summary>
/// <typeparam name="T"></typeparam>
/// <param name="method">Requested method (path after /v3/)</param>
@@ -165,6 +165,13 @@ namespace PocketSharp
}
/// <summary>
/// Puts/Updates a typed resource
/// </summary>
/// <typeparam name="T"></typeparam>
/// <param name="method">Requested method (path after /v3/)</param>
/// <param name="actions">Additional action parameters</param>
/// <returns></returns>
protected T Put<T>(string method, List<ActionParameter> actions) where T : class, new()
{
// put requests only with authentification
@@ -174,13 +181,23 @@ namespace PocketSharp
{
Actions = actions
};
//var x = (parameters.Convert());
return Get<T>(method, parameters.Convert());
}
/// <summary>
/// Puts/Updates a typed resource
/// </summary>
/// <typeparam name="T"></typeparam>
/// <param name="method">Requested method (path after /v3/)</param>
/// <param name="action">action parameter</param>
/// <returns></returns>
protected T Put<T>(string method, ActionParameter action) where T : class, new()
{
return Put<T>(method, new List<ActionParameter>() { action });
}
/// <summary>
/// Validates the response.
/// </summary>