Exemple #1
0
 public static Qualifier ToQualifier(this GlobalUniqueId guid)
 {
     return(new Qualifier
     {
         Anonymous = guid
     });
 }
Exemple #2
0
        /// <summary>
        /// Converts a <c>GlobalUniqueId</c> into a serializable string representation in base64,
        /// </summary>
        /// <param name="id">The ID</param>
        /// <returns>A base64 representation</returns>
        public static string ToBase64String(this GlobalUniqueId id)
        {
            switch (id.NumericalOrStringCase)
            {
            case GlobalUniqueId.NumericalOrStringOneofCase.Base64:
                return(id.Base64);

            case GlobalUniqueId.NumericalOrStringOneofCase.Guid:
                return(id.Guid.Raw.ToBase64());

            default:
                throw new NotImplementedException($"Missing implementation for '{id.NumericalOrStringCase}'");
            }
        }