public static T Select <T>(this IConsumerRequest request, Func <NameValueCollection, T> selectFunc) { try { return(selectFunc(request.ToBodyParameters())); } catch (ArgumentNullException) { throw Error.FailedToParseResponse(request.ToString()); } }
/// <summary> /// /// </summary> /// <typeparam name="T"></typeparam> /// <param name="request"></param> /// <param name="selectFunc"></param> /// <returns></returns> public static T Select <T>(this IConsumerRequest request, Func <NameValueCollection, T> selectFunc) { try { return(selectFunc(request.ToBodyParameters())); } catch (ArgumentNullException argumentException) { if (argumentException.Message.Contains("Value cannot be null.\r\nParameter name: str")) { throw Error.ExperiencingIssueWithCreatingUriDueToMissingAppConfig(argumentException); } throw Error.FailedToParseResponse(request.ToString()); } }