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 --- FireBase/Query/FilterQuery.cs | 77 ------------------------------------------- 1 file changed, 77 deletions(-) delete mode 100644 FireBase/Query/FilterQuery.cs (limited to 'FireBase/Query/FilterQuery.cs') diff --git a/FireBase/Query/FilterQuery.cs b/FireBase/Query/FilterQuery.cs deleted file mode 100644 index 3434d1d..0000000 --- a/FireBase/Query/FilterQuery.cs +++ /dev/null @@ -1,77 +0,0 @@ -using System; -using System.Globalization; - -namespace Firebase.Database.Query -{ - /// - /// Represents a firebase filtering query, e.g. "?LimitToLast=10". - /// - public class FilterQuery : ParameterQuery - { - private readonly Func boolValueFactory; - private readonly Func doubleValueFactory; - private readonly Func valueFactory; - - /// - /// Initializes a new instance of the class. - /// - /// The parent. - /// The filter. - /// The value for filter. - /// The owning client. - public FilterQuery(FirebaseQuery parent, Func filterFactory, Func valueFactory, - FirebaseClient client) - : base(parent, filterFactory, client) - { - this.valueFactory = valueFactory; - } - - /// - /// Initializes a new instance of the class. - /// - /// The parent. - /// The filter. - /// The value for filter. - /// The owning client. - public FilterQuery(FirebaseQuery parent, Func filterFactory, Func valueFactory, - FirebaseClient client) - : base(parent, filterFactory, client) - { - doubleValueFactory = valueFactory; - } - - /// - /// Initializes a new instance of the class. - /// - /// The parent. - /// The filter. - /// The value for filter. - /// The owning client. - public FilterQuery(FirebaseQuery parent, Func filterFactory, Func valueFactory, - FirebaseClient client) - : base(parent, filterFactory, client) - { - boolValueFactory = valueFactory; - } - - /// - /// The build url parameter. - /// - /// The child. - /// Url parameter part of the resulting path. - protected override string BuildUrlParameter(FirebaseQuery child) - { - if (valueFactory != null) - { - if (valueFactory() == null) return "null"; - return $"\"{valueFactory()}\""; - } - - if (doubleValueFactory != null) - return doubleValueFactory().ToString(CultureInfo.InvariantCulture); - if (boolValueFactory != null) return $"{boolValueFactory().ToString().ToLower()}"; - - return string.Empty; - } - } -} \ No newline at end of file -- cgit v1.2.3-70-g09d2