Beispiel #1
0
 public virtual Task SetAsync(ChildQuery query, string key, OfflineEntry entry)
 {
     if (entry.SyncOptions == SyncOptions.Put)
     {
         return(query.Child(key).PutAsync(entry.Data));
     }
     else
     {
         return(query.Child(key).PatchAsync(entry.Data));
     }
 }
Beispiel #2
0
        private async Task ResetAfterPull(Task <T> task, string key, OfflineEntry entry)
        {
            await task;

            this.SetAndRaise(key, new OfflineEntry(key, task.Result, entry.Priority, SyncOptions.None), FirebaseEventSource.OnlinePull);
        }
Beispiel #3
0
 private void SetAndRaise(string key, OfflineEntry obj, FirebaseEventSource eventSource = FirebaseEventSource.Offline)
 {
     this.Database[key] = obj;
     this.subject.OnNext(new FirebaseEvent <T>(key, obj?.Deserialize <T>(), string.IsNullOrEmpty(obj?.Data) || obj?.Data == "null" ? FirebaseEventType.Delete : FirebaseEventType.InsertOrUpdate, eventSource));
 }