From 304437b834e8c87687f68333ae67a13ee1377a73 Mon Sep 17 00:00:00 2001 From: Dennis Kobert Date: Wed, 12 Jun 2019 21:47:51 +0200 Subject: Adjust Codestyle --- dsa/FireBase/Offline/DatabaseExtensions.cs | 39 ++++++++++-------------------- 1 file changed, 13 insertions(+), 26 deletions(-) (limited to 'dsa/FireBase/Offline/DatabaseExtensions.cs') diff --git a/dsa/FireBase/Offline/DatabaseExtensions.cs b/dsa/FireBase/Offline/DatabaseExtensions.cs index e7c4074..75624f1 100644 --- a/dsa/FireBase/Offline/DatabaseExtensions.cs +++ b/dsa/FireBase/Offline/DatabaseExtensions.cs @@ -4,10 +4,8 @@ using System.Linq.Expressions; using System.Reflection; using Firebase.Database.Query; -namespace Firebase.Database.Offline -{ - public static class DatabaseExtensions - { +namespace Firebase.Database.Offline { + public static class DatabaseExtensions { /// /// Create new instances of the . /// @@ -24,8 +22,7 @@ namespace Firebase.Database.Offline public static RealtimeDatabase AsRealtimeDatabase(this ChildQuery query, string filenameModifier = "", string elementRoot = "", StreamingOptions streamingOptions = StreamingOptions.LatestOnly, InitialPullStrategy initialPullStrategy = InitialPullStrategy.MissingOnly, bool pushChanges = true) - where T : class - { + where T : class { return new RealtimeDatabase(query, elementRoot, query.Client.Options.OfflineDatabaseFactory, filenameModifier, streamingOptions, initialPullStrategy, pushChanges); } @@ -49,8 +46,7 @@ namespace Firebase.Database.Offline StreamingOptions streamingOptions = StreamingOptions.LatestOnly, InitialPullStrategy initialPullStrategy = InitialPullStrategy.MissingOnly, bool pushChanges = true) where T : class - where TSetHandler : ISetHandler, new() - { + where TSetHandler : ISetHandler, new() { return new RealtimeDatabase(query, elementRoot, query.Client.Options.OfflineDatabaseFactory, filenameModifier, streamingOptions, initialPullStrategy, pushChanges, Activator.CreateInstance()); @@ -68,8 +64,7 @@ namespace Firebase.Database.Offline /// public static void Patch(this RealtimeDatabase db, string key, T obj, bool syncOnline = true, int priority = 1) - where T : class - { + where T : class { db.Set(key, obj, syncOnline ? SyncOptions.Patch : SyncOptions.None, priority); } @@ -85,8 +80,7 @@ namespace Firebase.Database.Offline /// public static void Put(this RealtimeDatabase db, string key, T obj, bool syncOnline = true, int priority = 1) - where T : class - { + where T : class { db.Set(key, obj, syncOnline ? SyncOptions.Put : SyncOptions.None, priority); } @@ -101,8 +95,7 @@ namespace Firebase.Database.Offline /// /// The generated key for this object. public static string Post(this RealtimeDatabase db, T obj, bool syncOnline = true, int priority = 1) - where T : class - { + where T : class { var key = FirebaseKeyGenerator.Next(); db.Set(key, obj, syncOnline ? SyncOptions.Put : SyncOptions.None, priority); @@ -120,8 +113,7 @@ namespace Firebase.Database.Offline /// priority. /// public static void Delete(this RealtimeDatabase db, string key, bool syncOnline = true, int priority = 1) - where T : class - { + where T : class { db.Set(key, null, syncOnline ? SyncOptions.Put : SyncOptions.None, priority); } @@ -143,8 +135,7 @@ namespace Firebase.Database.Offline public static void Put(this RealtimeDatabase db, string key, Expression> propertyExpression, TProperty value, bool syncOnline = true, int priority = 1) - where T : class - { + where T : class { db.Set(key, propertyExpression, value, syncOnline ? SyncOptions.Put : SyncOptions.None, priority); } @@ -166,8 +157,7 @@ namespace Firebase.Database.Offline public static void Patch(this RealtimeDatabase db, string key, Expression> propertyExpression, TProperty value, bool syncOnline = true, int priority = 1) - where T : class - { + where T : class { db.Set(key, propertyExpression, value, syncOnline ? SyncOptions.Patch : SyncOptions.None, priority); } @@ -189,8 +179,7 @@ namespace Firebase.Database.Offline public static void Delete(this RealtimeDatabase db, string key, Expression> propertyExpression, bool syncOnline = true, int priority = 1) where T : class - where TProperty : class - { + where TProperty : class { db.Set(key, propertyExpression, null, syncOnline ? SyncOptions.Put : SyncOptions.None, priority); } @@ -215,8 +204,7 @@ namespace Firebase.Database.Offline Expression> propertyExpression, TProperty value, bool syncOnline = true, int priority = 1) where T : class - where TSelector : IDictionary - { + where TSelector : IDictionary { var nextKey = FirebaseKeyGenerator.Next(); var expression = Expression.Lambda>( Expression.Call(propertyExpression.Body, @@ -245,8 +233,7 @@ namespace Firebase.Database.Offline public static void Delete(this RealtimeDatabase db, string key, Expression>> propertyExpression, string dictionaryKey, bool syncOnline = true, int priority = 1) - where T : class - { + where T : class { var expression = Expression.Lambda>( Expression.Call(propertyExpression.Body, typeof(IDictionary).GetRuntimeMethod("get_Item", new[] {typeof(string)}), -- cgit v1.2.3-54-g00ecf