/// <summary>
 /// Get instance <br />
 /// 获取实例
 /// </summary>
 /// <param name="context"></param>
 /// <typeparam name="T"></typeparam>
 /// <returns></returns>
 /// <exception cref="ArgumentNullException"></exception>
 public static T GetInstance <T>(this VerifiableObjectContext context)
 {
     if (context is null)
     {
         throw new ArgumentNullException(nameof(context));
     }
     return(context.Instance.As <T>());
 }
        private VerifiableMemberContext(object value, VerifiableMemberContract contract, VerifiableObjectContext parentContext)
        {
            _parentContext = parentContext;
            _contract      = contract ?? throw new ArgumentNullException(nameof(contract));
            _valueMode     = ValueMode.DirectValue;

            _hasGot      = true;
            _valueCached = value;
        }
        internal VerifiableObjectContext(object targetObject, VerifiableObjectContract contract, VerifiableObjectContext parentContext)
        {
            _targetObject = targetObject;
            _contract     = contract ?? throw new ArgumentNullException(nameof(contract));
            _directMode   = true;
            _keyValueRef  = null;
            InstanceName  = contract.IsBasicType ? VerifiableMemberContract.BASIC_TYPE : "Instance";

            ParentContext  = parentContext;
            IsChildContext = parentContext is not null;
        }
 /// <summary>
 /// Create <br />
 /// 创建
 /// </summary>
 /// <param name="value"></param>
 /// <param name="contract"></param>
 /// <param name="parentContext"></param>
 /// <typeparam name="T"></typeparam>
 /// <returns></returns>
 public static VerifiableMemberContext Create <T>(T value, VerifiableMemberContract contract, VerifiableObjectContext parentContext = default)
 {
     return(new(value, contract, parentContext));
 }
 public VerifiableMemberContext(VerifiableObjectContext parentContext, VerifiableMemberContract contract, bool directMode)
 {
     _parentContext = parentContext;
     _contract      = contract ?? throw new ArgumentNullException(nameof(contract));
     _valueMode     = directMode ? ValueMode.DirectType : ValueMode.Dictionary;
 }