Generating 2 comma-separated lists from list of key value pairs
Performance here will only matter if the input List is large. There are two things that can be done to make the output loop faster:


initialize the starting capacity of the StringBuilder to match your expectations of what size it will need to be.

In this case, you know the GUUID's are 36 characters long, with a comma, makes it 37. You should initialize that StringBuilder to ... new StringBuilder(37 * kvps.Count);. Similarly, if you have an approximate size of the average length for the other Stringbuilder, then double-it, and use it as the initial capacity constructor.
If the loop happens (very) often, you can get a very slight performance improvement by doing the following (removing the if condition from inside the loop):

foreach (KeyValuePair kv in kvps)
{
    a.Append(kv.Key);
    a.Append(",");
    b.Append(kv.Value);
    b.Append(",");
}
// remove the trailing comma.
if (kvps.Count &gt; 0) {
    a.Length = a.Length - 1;
    b.Length = b.Length - 1;
}



It should go without saying that the names a and b are bad names for the StringBuilder instances ....