internal static class Constants {
public static string GUID(Type type) {
return type switch {
TypeA => "DEADBEEF-FEEE-FEEE-CDCD-000000000000",
TypeB => "DEADBEEF-FEEE-FEEE-CDCD-000000000001",
TypeC => "DEADBEEF-FEEE-FEEE-CDCD-000000000002",
TypeEtc => "DEADBEEF-FEEE-FEEE-CDCD-000000000004",
null => throw new ArgumentNullException(
$"GUID lookup failed, {nameof(type)} is null"
),
_ => throw new ArgumentException(
$"GUID lookup failed, type {type.Name} missing from GUID map"
),
};
}
}
internal static class Constants {
public static string GUID(Type type) {
return type switch {
TypeA => "DEADBEEF-FEEE-FEEE-CDCD-000000000000",
TypeB => "DEADBEEF-FEEE-FEEE-CDCD-000000000001",
TypeC => "DEADBEEF-FEEE-FEEE-CDCD-000000000002",
TypeEtc => "DEADBEEF-FEEE-FEEE-CDCD-000000000004",
null => throw new ArgumentNullException(
$"GUID lookup failed, {nameof(type)} is null"
),
_ => throw new ArgumentException(
$"GUID lookup failed, type {type.Name} missing from GUID map"
),
};
}
}