示例#1
0
 public void SetData(object documentData, CompletionHandler handler, params FieldPath[] mergeFields)
 {
     _documentReference.Set(documentData.ToNativeFieldValues(), SetOptions.MergeFieldPaths(new JavaList <Firebase.Firestore.FieldPath>(mergeFields.Select(x => x.ToNative())))).AddOnCompleteListener(new OnCompleteHandlerListener((task) =>
     {
         handler?.Invoke(task.IsSuccessful ? null : ExceptionMapper.Map(task.Exception));
     }));
 }
示例#2
0
        public Task SetDataAsync(object documentData, params FieldPath[] mergeFields)
        {
            var tcs = new TaskCompletionSource <bool>();

            _documentReference.Set(documentData.ToNativeFieldValues(), SetOptions.MergeFieldPaths(new JavaList <Firebase.Firestore.FieldPath>(mergeFields.Select(x => x.ToNative())))).AddOnCompleteListener(new OnCompleteHandlerListener((task) =>
            {
                if (task.IsSuccessful)
                {
                    tcs.SetResult(true);
                }
                else
                {
                    tcs.SetException(ExceptionMapper.Map(task.Exception));
                }
            }));

            return(tcs.Task);
        }
示例#3
0
        public void SetData(IDocumentReference document, object documentData, params FieldPath[] mergeFields)
        {
            var wrapper = (DocumentReferenceWrapper)document;

            _writeBatch.Set((DocumentReference)wrapper, documentData.ToNativeFieldValues(), SetOptions.MergeFieldPaths(new JavaList <Firebase.Firestore.FieldPath>(mergeFields.Select(x => x.ToNative()))));
        }
        public ITransaction Set <T>(IDocumentReference document, T documentData, params FieldPath[] mergeFields)
        {
            var wrapper = (DocumentReferenceWrapper)document;

            _transaction.Set((DocumentReference)wrapper, documentData.ToNativeFieldValues(), SetOptions.MergeFieldPaths(new JavaList <Firebase.Firestore.FieldPath>(mergeFields.Select(x => x.ToNative()))));
            return(this);
        }
 public void SetData(IDocumentReference document, object documentData, params FieldPath[] mergeFields)
 {
     _transaction.Set(document.ToNative(), documentData.ToNativeFieldValues(), SetOptions.MergeFieldPaths(new JavaList <Firebase.Firestore.FieldPath>(mergeFields.Select(x => x.ToNative()))));
 }
示例#6
0
 public IWriteBatch Set <T>(IDocumentReference document, T documentData, params FieldPath[] mergeFields)
 {
     _writeBatch.Set(document.ToNative(), documentData.ToNativeFieldValues(), SetOptions.MergeFieldPaths(new JavaList <Firebase.Firestore.FieldPath>(mergeFields.Select(x => x.ToNative()))));
     return(this);
 }