From de0f076ef9ff546c9a90513259ad6c42cd2224b3 Mon Sep 17 00:00:00 2001 From: TrueDoctor Date: Sat, 29 Sep 2018 16:51:26 +0200 Subject: added firebase api --- FireBase/Query/OrderQuery.cs | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 FireBase/Query/OrderQuery.cs (limited to 'FireBase/Query/OrderQuery.cs') diff --git a/FireBase/Query/OrderQuery.cs b/FireBase/Query/OrderQuery.cs new file mode 100644 index 0000000..46ebd2c --- /dev/null +++ b/FireBase/Query/OrderQuery.cs @@ -0,0 +1,34 @@ +namespace Firebase.Database.Query +{ + using System; + + /// + /// Represents a firebase ordering query, e.g. "?OrderBy=Foo". + /// + public class OrderQuery : ParameterQuery + { + private readonly Func propertyNameFactory; + + /// + /// Initializes a new instance of the class. + /// + /// The query parent. + /// The property name. + /// The owning client. + public OrderQuery(ChildQuery parent, Func propertyNameFactory, FirebaseClient client) + : base(parent, () => "orderBy", client) + { + this.propertyNameFactory = propertyNameFactory; + } + + /// + /// The build url parameter. + /// + /// The child. + /// The . + protected override string BuildUrlParameter(FirebaseQuery child) + { + return $"\"{this.propertyNameFactory()}\""; + } + } +} -- cgit v1.2.3-54-g00ecf