public void AddDocument(object data, CompletionHandler handler)
 {
     _collectionReference.AddDocument(data.ToNativeFieldValues(), (error) =>
     {
         handler?.Invoke(error == null ? null : ExceptionMapper.Map(error));
     });
 }
示例#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 void Commit(CompletionHandler handler)
 {
     WriteBatch.Commit().AddOnCompleteListener(new OnCompleteHandlerListener((task) =>
     {
         handler?.Invoke(task.IsSuccessful ? null : new CloudFirestoreException(task.Exception.Message));
     }));
 }
示例#4
0
 public void DeleteDocument(CompletionHandler handler)
 {
     _documentReference.Delete().AddOnCompleteListener(new OnCompleteHandlerListener((task) =>
     {
         handler?.Invoke(task.IsSuccessful ? null : ExceptionMapper.Map(task.Exception));
     }));
 }
示例#5
0
 public void Commit(CompletionHandler handler)
 {
     WriteBatch.Commit((error) =>
     {
         handler?.Invoke(error == null ? null : new CloudFirestoreException(error.LocalizedDescription));
     });
 }
 public void SetData <T>(T documentData, IEnumerable <string> mergeFields, CompletionHandler handler) where T : class
 {
     DocumentReference.SetData(documentData.ToNativeFieldValues(), mergeFields.ToArray(), (error) =>
     {
         handler?.Invoke(error == null ? null : new CloudFirestoreException(error.LocalizedDescription));
     });
 }
 public void SetData(object documentData, CompletionHandler handler)
 {
     _documentReference.Set(documentData.ToNativeFieldValue()).AddOnCompleteListener(new OnCompleteHandlerListener((task) =>
     {
         handler?.Invoke(task.IsSuccessful ? null : ExceptionMapper.Map(task.Exception));
     }));
 }
示例#8
0
 public void SetData(object documentData, CompletionHandler handler, params FieldPath[] mergeFields)
 {
     _documentReference.SetData(documentData.ToNativeFieldValues(), mergeFields.Select(x => x.ToNative()).ToArray(), (error) =>
     {
         handler?.Invoke(error == null ? null : ExceptionMapper.Map(error));
     });
 }
示例#9
0
 public void DeleteDocument(CompletionHandler handler)
 {
     DocumentReference.Delete().AddOnCompleteListener(new OnCompleteHandlerListener((task) =>
     {
         handler?.Invoke(task.IsSuccessful ? null : new CloudFirestoreException(task.Exception.Message));
     }));
 }
示例#10
0
 public void SetData <T>(T documentData, IEnumerable <string> mergeFields, CompletionHandler handler) where T : class
 {
     DocumentReference.Set(documentData.ToNativeFieldValues(), SetOptions.MergeFields(mergeFields.ToArray())).AddOnCompleteListener(new OnCompleteHandlerListener((task) =>
     {
         handler?.Invoke(task.IsSuccessful ? null : new CloudFirestoreException(task.Exception.Message));
     }));
 }
示例#11
0
 public void UpdateData <T>(T fields, CompletionHandler handler) where T : class
 {
     DocumentReference.Update(fields.ToNativeFieldValues()).AddOnCompleteListener(new OnCompleteHandlerListener((task) =>
     {
         handler?.Invoke(task.IsSuccessful ? null : new CloudFirestoreException(task.Exception.Message));
     }));
 }
示例#12
0
 public void UpdateData <T>(string field, T value, CompletionHandler handler, params object[] moreFieldsAndValues)
 {
     DocumentReference.Update(field, value.ToNativeFieldValue(), moreFieldsAndValues.Select(x => x.ToNativeFieldValue()).ToArray()).AddOnCompleteListener(new OnCompleteHandlerListener((task) =>
     {
         handler?.Invoke(task.IsSuccessful ? null : new CloudFirestoreException(task.Exception.Message));
     }));
 }
 public void DeleteDocument(CompletionHandler handler)
 {
     DocumentReference.DeleteDocument((error) =>
     {
         handler?.Invoke(error == null ? null : new CloudFirestoreException(error.LocalizedDescription));
     });
 }
示例#14
0
 public void UpdateData(object fields, CompletionHandler handler)
 {
     _documentReference.UpdateData(fields.ToNativeFieldValues(), (error) =>
     {
         handler?.Invoke(error == null ? null : ExceptionMapper.Map(error));
     });
 }
示例#15
0
 public void SetData(object documentData, bool merge, CompletionHandler handler)
 {
     _documentReference.SetData(documentData.ToNativeFieldValues(), merge, (error) =>
     {
         handler?.Invoke(error == null ? null : ExceptionMapper.Map(error));
     });
 }
 public void AddDocument <T>(T data, CompletionHandler handler) where T : class
 {
     CollectionReference.AddDocument(data.ToNativeFieldValues(), (error) =>
     {
         handler?.Invoke(error == null ? null : new CloudFirestoreException(error.LocalizedDescription));
     });
 }
示例#17
0
 public void DeleteDocument(CompletionHandler handler)
 {
     _documentReference.DeleteDocument((error) =>
     {
         handler?.Invoke(error == null ? null : ExceptionMapper.Map(error));
     });
 }
示例#18
0
 public void UpdateData(object fields, CompletionHandler handler)
 {
     _documentReference.Update(fields.ToNativeFieldValues()).AddOnCompleteListener(new OnCompleteHandlerListener((task) =>
     {
         handler?.Invoke(task.IsSuccessful ? null : ExceptionMapper.Map(task.Exception));
     }));
 }
示例#19
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));
     }));
 }
示例#20
0
 public void SetData(object documentData, CompletionHandler handler, params string[] mergeFields)
 {
     _documentReference.Set(documentData.ToNativeFieldValues(), SetOptions.MergeFields(mergeFields)).AddOnCompleteListener(new OnCompleteHandlerListener((task) =>
     {
         handler?.Invoke(task.IsSuccessful ? null : ExceptionMapper.Map(task.Exception));
     }));
 }
示例#21
0
 public void Commit(CompletionHandler handler)
 {
     _writeBatch.Commit((error) =>
     {
         handler?.Invoke(error == null ? null : ExceptionMapper.Map(error));
     });
 }
示例#22
0
 public void Commit(CompletionHandler handler)
 {
     _writeBatch.Commit().AddOnCompleteListener(new OnCompleteHandlerListener((task) =>
     {
         handler?.Invoke(task.IsSuccessful ? null : ExceptionMapper.Map(task.Exception));
     }));
 }
 public void UpdateData <T>(T fields, CompletionHandler handler) where T : class
 {
     DocumentReference.UpdateData(fields.ToNativeFieldValues(), (error) =>
     {
         handler?.Invoke(error == null ? null : new CloudFirestoreException(error.LocalizedDescription));
     });
 }
 public void AddDocument <T>(T data, CompletionHandler handler) where T : class
 {
     CollectionReference.Add(data.ToNativeFieldValues())
     .AddOnCompleteListener(new OnCompleteHandlerListener((task) =>
     {
         handler?.Invoke(task.IsSuccessful ? null : new CloudFirestoreException(task.Exception.Message));
     }));
 }
示例#25
0
 public void AddDocument(object data, CompletionHandler handler)
 {
     _collectionReference.Add(data.ToNativeFieldValues())
     .AddOnCompleteListener(new OnCompleteHandlerListener((task) =>
     {
         handler?.Invoke(task.IsSuccessful ? null : ExceptionMapper.Map(task.Exception));
     }));
 }
        public void UpdateData <T>(string field, T value, CompletionHandler handler, params object[] moreFieldsAndValues)
        {
            var fields = Field.CreateFields(field, value, moreFieldsAndValues);

            DocumentReference.UpdateData(fields, (error) =>
            {
                handler?.Invoke(error == null ? null : new CloudFirestoreException(error.LocalizedDescription));
            });
        }
示例#27
0
        public void UpdateData(FieldPath field, object?value, CompletionHandler handler, params object?[] moreFieldsAndValues)
        {
            var fields = Field.CreateFields(field, value, moreFieldsAndValues);

            _documentReference.UpdateData(fields, (error) =>
            {
                handler?.Invoke(error == null ? null : ExceptionMapper.Map(error));
            });
        }
示例#28
0
        public void SetData(object documentData, bool merge, CompletionHandler handler)
        {
            if (!merge)
            {
                SetData(documentData, handler);
                return;
            }

            _documentReference.Set(documentData.ToNativeFieldValues(), SetOptions.Merge()).AddOnCompleteListener(new OnCompleteHandlerListener((task) =>
            {
                handler?.Invoke(task.IsSuccessful ? null : ExceptionMapper.Map(task.Exception));
            }));
        }
示例#29
0
        public void SetData <T>(T documentData, bool merge, CompletionHandler handler) where T : class
        {
            if (!merge)
            {
                SetData(documentData, handler);
                return;
            }

            DocumentReference.Set(documentData.ToNativeFieldValues(), SetOptions.Merge()).AddOnCompleteListener(new OnCompleteHandlerListener((task) =>
            {
                handler?.Invoke(task.IsSuccessful ? null : new CloudFirestoreException(task.Exception.Message));
            }));
        }
示例#30
0
 public override void DidFinishEventsForBackgroundSession(NSUrlSession session)
 {
     this.manager.CompleteSession();
     CompletionHandler?.Invoke();
 }