From e6181c24124d97f2fbc932b8a68311e625463156 Mon Sep 17 00:00:00 2001 From: uzvkl Date: Tue, 11 Jun 2019 23:05:52 +0200 Subject: Move dsa related stuff to subfolder --- dsa/FireBase/Offline/SetHandler.cs | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 dsa/FireBase/Offline/SetHandler.cs (limited to 'dsa/FireBase/Offline/SetHandler.cs') diff --git a/dsa/FireBase/Offline/SetHandler.cs b/dsa/FireBase/Offline/SetHandler.cs new file mode 100644 index 0000000..6314c3c --- /dev/null +++ b/dsa/FireBase/Offline/SetHandler.cs @@ -0,0 +1,19 @@ +using System.Threading.Tasks; +using Firebase.Database.Query; + +namespace Firebase.Database.Offline +{ + public class SetHandler : ISetHandler + { + 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); + } + } + } +} \ No newline at end of file -- cgit v1.2.3-70-g09d2