You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

35 lines
993 B

using System;
using System.Collections.Generic;
namespace RadarrSharp.Helpers
{
public static class RadarrExtensions
{
public static Tuple<string,string> ToTuple(this object value, string key)
{
if (value == null)
return null;
return new Tuple<string, string>(key, value.ToString());
}
public static List<Tuple<string,string>> ToList(this Tuple<string, string> tuple)
{
if (tuple == null)
return null;
return new List<Tuple<string, string>>() { tuple };
}
public static List<Tuple<string, string>> ParamList(params Tuple<string,string>[] tuples)
{
if (tuples == null)
return null;
var combinedTuples = new List<Tuple<string, string>>();
foreach (var p in tuples)
{
combinedTuples.Add(p);
}
return combinedTuples;
}
}
}