Files

18 lines
518 B
C#

namespace Application.Endpoints;
public class IdentifierGenerator
{
public static string GenerateId(Guid id1, Guid id2)
{
// Convert GUIDs to strings
var strId1 = id1.ToString();
var strId2 = id2.ToString();
// Sort the GUID strings
var firstId = strId1.CompareTo(strId2) < 0 ? strId1 : strId2;
var secondId = strId1.CompareTo(strId2) < 0 ? strId2 : strId1;
// Combine them to get a symmetric string
return firstId + "-" + secondId;
}
}