コード例 #1
0
        public Parameters SetValue(string name, object value)
        {
            CBDebug.MustNotBeNull(Log.To.Query, Tag, nameof(name), name);

            _freezer.PerformAction(() => _params[name] = value);
            return(this);
        }
コード例 #2
0
        public Parameters SetValue([NotNull] string name, [CanBeNull] object value)
        {
            CBDebug.MustNotBeNull(WriteLog.To.Query, Tag, nameof(name), name);

            // HACK: Use side effect of data validation
            var cbVal = DataOps.ToCouchbaseObject(value);

            if (cbVal is MutableDictionaryObject || cbVal is MutableArrayObject)
            {
                throw new ArgumentException(CouchbaseLiteErrorMessage.QueryParamNotAllowedContainCollections);
            }

            _freezer.PerformAction(() => _params[name] = value);

            return(this);
        }
コード例 #3
0
        public Parameters SetValue(string name, object value)
        {
            CBDebug.MustNotBeNull(Log.To.Query, Tag, nameof(name), name);

            // HACK: Use side effect of data validation
            var cbVal = DataOps.ToCouchbaseObject(value);

            if (cbVal is MutableDictionaryObject || cbVal is MutableArrayObject)
            {
                throw new ArgumentException("Query parameters are not allowed to contain collections");
            }

            _freezer.PerformAction(() => _params[name] = value);

            return(this);
        }