/// <summary>
        /// Initializes a new instance of the <see cref="UdiEntityType"/> struct.
        /// </summary>
        /// <param name="type">The entity type.</param>
        /// <param name="value">The entity type value.</param>
        public UdiEntityType(UdiType type, string value)
        {
            if (string.IsNullOrWhiteSpace(value))
            {
                throw new ArgumentException(nameof(value));
            }

            this.Type  = type;
            this.Value = Uri.UnescapeDataString(value);
        }
 public UdiDefinitionAttribute(string entityType, UdiType udiType)
 {
     if (string.IsNullOrWhiteSpace(entityType))
     {
         throw new ArgumentNullException("entityType");
     }
     if (udiType != UdiType.GuidUdi && udiType != UdiType.StringUdi)
     {
         throw new ArgumentException("Invalid value.", "udiType");
     }
     EntityType = entityType;
     UdiType    = udiType;
 }
Exemplo n.º 3
0
 /// <summary>
 /// Registers a custom entity type.
 /// </summary>
 /// <param name="entityType"></param>
 /// <param name="udiType"></param>
 public static void RegisterUdiType(string entityType, UdiType udiType) => UdiTypes.TryAdd(entityType, udiType);
 public UdiTypeAttribute(UdiType udiType)
 {
     UdiType = udiType;
 }