public static string showElementWithTestType1 <Key>(this DBElement <Key, string> elem) { StringBuilder accum = new StringBuilder(); accum.Append(elem.showElemMetaData <Key, string>()); if (elem.payload != null) { accum.Append(String.Format("\n payload: {0}", elem.payload.ToString())); } return(accum.ToString()); }
public static string showElementWithTestType2 <Key>(this DBElement <Key, List <string> > elem) { StringBuilder accum = new StringBuilder(); accum.Append(elem.showElemMetaData <Key, List <string> >()); if (elem.payload != null) { bool first = true; accum.Append(String.Format("\n payload:\n ")); foreach (var item in elem.payload) { if (first) { accum.Append(String.Format("{0}", item)); first = false; } else { accum.Append(String.Format(", {0}", item)); } } } return(accum.ToString()); }