/// <summary> /// Adds NextLinkParams key value pairs from a source IResult to a destination IResult. /// /// The destination result's NextLinkParams dictionary reference will remain unchanged. /// </summary> /// <param name="destinationResult">IResult destination to which next link params are copied</param> /// <param name="sourceResult">IResult source from which to copy next link params</param> /// <typeparam name="T"></typeparam> /// <returns>Reference to NextLinkParams</returns> public static Dictionary <string, string> AddNextLinkParams <T>(this IResult <T> destinationResult, IResult <T> sourceResult) { if (destinationResult == null) { return(null); } if (sourceResult == null || sourceResult.NextLinkParams == null) { return(destinationResult.NextLinkParams); } foreach (var pair in sourceResult.NextLinkParams) { destinationResult.AddNextLinkParam(pair.Key, pair.Value); } return(destinationResult.NextLinkParams); }
public static Dictionary <string, string> AddNextLinkParam <T>(this IResult <T> result, string key, int value) => result.AddNextLinkParam(key, value.ToString());