diff options
author | Dennis Kobert <d-kobert@web.de> | 2019-06-11 23:38:13 +0200 |
---|---|---|
committer | Dennis Kobert <d-kobert@web.de> | 2019-06-11 23:38:13 +0200 |
commit | 2fa4a0e50ebfc97059c8b84dbd17e79f9afc8a8d (patch) | |
tree | c3b34ccb2737e347a73768536895cbbaab13cc01 /FireBase/Query/ParameterQuery.cs | |
parent | ec991104f56e90d7bb2878da2fe6ed4e585dfc46 (diff) | |
parent | af74efccf8d21e6151022b71f3cacd3fa83024ee (diff) |
Merge branch 'rework-backend'
Diffstat (limited to 'FireBase/Query/ParameterQuery.cs')
-rw-r--r-- | FireBase/Query/ParameterQuery.cs | 43 |
1 files changed, 0 insertions, 43 deletions
diff --git a/FireBase/Query/ParameterQuery.cs b/FireBase/Query/ParameterQuery.cs deleted file mode 100644 index e3d9717..0000000 --- a/FireBase/Query/ParameterQuery.cs +++ /dev/null @@ -1,43 +0,0 @@ -namespace Firebase.Database.Query -{ - using System; - - /// <summary> - /// Represents a parameter in firebase query, e.g. "?data=foo". - /// </summary> - public abstract class ParameterQuery : FirebaseQuery - { - private readonly Func<string> parameterFactory; - private readonly string separator; - - /// <summary> - /// Initializes a new instance of the <see cref="ParameterQuery"/> class. - /// </summary> - /// <param name="parent"> The parent of this query. </param> - /// <param name="parameterFactory"> The parameter. </param> - /// <param name="client"> The owning client. </param> - protected ParameterQuery(FirebaseQuery parent, Func<string> parameterFactory, FirebaseClient client) - : base(parent, client) - { - this.parameterFactory = parameterFactory; - this.separator = (this.Parent is ChildQuery) ? "?" : "&"; - } - - /// <summary> - /// Build the url segment represented by this query. - /// </summary> - /// <param name="child"> The child. </param> - /// <returns> The <see cref="string"/>. </returns> - protected override string BuildUrlSegment(FirebaseQuery child) - { - return $"{this.separator}{this.parameterFactory()}={this.BuildUrlParameter(child)}"; - } - - /// <summary> - /// The build url parameter. - /// </summary> - /// <param name="child"> The child. </param> - /// <returns> The <see cref="string"/>. </returns> - protected abstract string BuildUrlParameter(FirebaseQuery child); - } -} |