/// <summary>Returns a typed version of a tuple of size 2</summary> /// <typeparam name="T1">Expected type of the first element</typeparam> /// <typeparam name="T2">Expected type of the second element</typeparam> /// <param name="tuple">Tuple that must be of size 2</param> /// <returns>Equivalent tuple, with its elements converted to the specified types</returns> public static FdbTuple <T1, T2> As <T1, T2>([NotNull] this IFdbTuple tuple) { tuple.OfSize(2); return(new FdbTuple <T1, T2>( tuple.Get <T1>(0), tuple.Get <T2>(1) )); }
/// <summary>Returns a typed version of a tuple of size 4</summary> /// <typeparam name="T1">Expected type of the first element</typeparam> /// <typeparam name="T2">Expected type of the second element</typeparam> /// <typeparam name="T3">Expected type of the third element</typeparam> /// <typeparam name="T4">Expected type of the fourth element</typeparam> /// <param name="tuple">Tuple that must be of size 4</param> /// <returns>Equivalent tuple, with its elements converted to the specified types</returns> public static FdbTuple <T1, T2, T3, T4> As <T1, T2, T3, T4>([NotNull] this IFdbTuple tuple) { tuple.OfSize(4); return(new FdbTuple <T1, T2, T3, T4>( tuple.Get <T1>(0), tuple.Get <T2>(1), tuple.Get <T3>(2), tuple.Get <T4>(3) )); }
public T FromTuple(IFdbTuple tuple) { return(tuple.OfSize(1).Get <T>(0)); }