コード例 #1
0
        public ITransaction Update(IDocumentReference document, FieldPath field, object?value, params object?[] moreFieldsAndValues)
        {
            var wrapper = (DocumentReferenceWrapper)document;

            _transaction.Update((DocumentReference)wrapper, field?.ToNative(), value.ToNativeFieldValue(), moreFieldsAndValues.Select(x => x.ToNativeFieldValue()).ToArray());
            return(this);
        }
コード例 #2
0
 public void UpdateData(FieldPath field, object value, CompletionHandler handler, params object[] moreFieldsAndValues)
 {
     _documentReference.Update(field.ToNative(), value.ToNativeFieldValue(), moreFieldsAndValues.Select(x => x.ToNativeFieldValue()).ToArray()).AddOnCompleteListener(new OnCompleteHandlerListener((task) =>
     {
         handler?.Invoke(task.IsSuccessful ? null : ExceptionMapper.Map(task.Exception));
     }));
 }
コード例 #3
0
        public IQuery OrderBy(FieldPath field, bool descending)
        {
            var direction = descending ? Query.Direction.Descending : Query.Direction.Ascending;

            var query = _query.OrderBy(field.ToNative(), direction);

            return(new QueryWrapper(query));
        }
コード例 #4
0
        public Task UpdateDataAsync(FieldPath field, object value, params object[] moreFieldsAndValues)
        {
            var tcs = new TaskCompletionSource <bool>();

            _documentReference.Update(field.ToNative(), value.ToNativeFieldValue(), moreFieldsAndValues.Select(x => x.ToNativeFieldValue()).ToArray()).AddOnCompleteListener(new OnCompleteHandlerListener((task) =>
            {
                if (task.IsSuccessful)
                {
                    tcs.SetResult(true);
                }
                else
                {
                    tcs.SetException(ExceptionMapper.Map(task.Exception));
                }
            }));

            return(tcs.Task);
        }
コード例 #5
0
        public IQuery WhereLessThan(FieldPath field, object value)
        {
            var query = _query.WhereLessThan(field.ToNative(), value.ToNativeFieldValue());

            return(new QueryWrapper(query));
        }
コード例 #6
0
        public IQuery WhereArrayContains(FieldPath field, object value)
        {
            var query = _query.WhereArrayContains(field.ToNative(), value.ToNativeFieldValue());

            return(new QueryWrapper(query));
        }
コード例 #7
0
 public T Get <T>(FieldPath field, ServerTimestampBehavior serverTimestampBehavior)
 {
     return((T)_documentSnapshot.GetValue(field?.ToNative(), serverTimestampBehavior.ToNative()).ToFieldValue(new DocumentFieldInfo <T>()));
 }
コード例 #8
0
        public IQuery WhereEqualsTo(FieldPath field, object?value)
        {
            var query = _collectionReference.WhereEqualsTo(field?.ToNative() !, value.ToNativeFieldValue());

            return(new QueryWrapper(query));
        }
コード例 #9
0
        public IQuery WhereEqualsTo(FieldPath field, object?value)
        {
            var query = _query.WhereEqualTo(field?.ToNative(), value.ToNativeFieldValue());

            return(new QueryWrapper(query));
        }
コード例 #10
0
 public T Get <T>(FieldPath field)
 {
     return((T)_documentSnapshot.GetValue(field?.ToNative()).ToFieldValue(new DocumentFieldInfo <T>()));
 }
コード例 #11
0
        public IQuery WhereArrayContains(FieldPath field, object value)
        {
            var query = _collectionReference.WhereArrayContains(field?.ToNative() !, value.ToNativeFieldValue());

            return(new QueryWrapper(query));
        }
コード例 #12
0
        public IQuery WhereLessThanOrEqualsTo(FieldPath field, object value)
        {
            var query = _collectionReference.WhereLessThanOrEqualTo(field.ToNative(), value.ToNativeFieldValue());

            return(new QueryWrapper(query));
        }
コード例 #13
0
        public IQuery WhereArrayContainsAny(FieldPath field, IEnumerable <object> values)
        {
            var query = _query.WhereArrayContains(field?.ToNative(), values?.Select(x => x.ToNativeFieldValue()).ToArray());

            return(new QueryWrapper(query));
        }
コード例 #14
0
        public IQuery WhereGreaterThanOrEqualsTo(FieldPath field, object value)
        {
            var query = _query.WhereGreaterThanOrEqualsTo(field.ToNative(), value.ToNativeFieldValue());

            return(new QueryWrapper(query));
        }
コード例 #15
0
        public IQuery WhereIn(FieldPath field, IEnumerable <object> values)
        {
            var query = _collectionReference.WhereFieldIn(field?.ToNative(), values?.Select(x => x.ToNativeFieldValue()).ToArray());

            return(new QueryWrapper(query));
        }
コード例 #16
0
        public IQuery WhereGreaterThan(FieldPath field, object value)
        {
            var query = _collectionReference.WhereGreaterThan(field.ToNative(), value.ToNativeFieldValue());

            return(new QueryWrapper(query));
        }
コード例 #17
0
        public IQuery OrderBy(FieldPath field)
        {
            var query = _collectionReference.OrderBy(field.ToNative());

            return(new QueryWrapper(query));
        }
コード例 #18
0
        public IQuery OrderBy(FieldPath field)
        {
            var query = _query.OrderedBy(field.ToNative());

            return(new QueryWrapper(query));
        }
コード例 #19
0
        public IQuery WhereIn(FieldPath field, IEnumerable <object> values)
        {
            var query = _query.WhereIn(field?.ToNative(), values?.Select(x => x.ToNativeFieldValue()).ToList());

            return(new QueryWrapper(query));
        }
コード例 #20
0
        public IQuery OrderBy(FieldPath field, bool descending)
        {
            var query = _query.OrderedBy(field.ToNative(), descending);

            return(new QueryWrapper(query));
        }
コード例 #21
0
        public IQuery OrderBy(FieldPath field, bool descending)
        {
            var query = _collectionReference.OrderedBy(field?.ToNative(), descending);

            return(new QueryWrapper(query));
        }
コード例 #22
0
        public void UpdateData(IDocumentReference document, FieldPath field, object value, params object[] moreFieldsAndValues)
        {
            var wrapper = (DocumentReferenceWrapper)document;

            _writeBatch.Update((DocumentReference)wrapper, field.ToNative(), value.ToNativeFieldValue(), moreFieldsAndValues.Select(x => x.ToNativeFieldValue()).ToArray());
        }
コード例 #23
0
 public IWriteBatch Update(IDocumentReference document, FieldPath field, object?value, params object?[] moreFieldsAndValues)
 {
     _writeBatch.Update(document.ToNative(), field?.ToNative(), value.ToNativeFieldValue(), moreFieldsAndValues.Select(x => x.ToNativeFieldValue()).ToArray());
     return(this);
 }