Ejemplo n.º 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));
     }
 }
Ejemplo n.º 2
0
 public virtual async Task SetAsync(ChildQuery query, string key, OfflineEntry entry)
 {
     using (var child = query.Child(key))
     {
         if (entry.SyncOptions == SyncOptions.Put)
         {
             await child.PutAsync(entry.Data);
         }
         else
         {
             await child.PatchAsync(entry.Data);
         }
     }
 }
Ejemplo n.º 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));
 }
Ejemplo n.º 4
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);
        }
Ejemplo n.º 5
0
 public virtual Task PutAsync(ChildQuery query, string key, OfflineEntry entry)
 {
     return(query.Child(key).PutAsync(entry.Deserialize <T>()));
 }