Esempio n. 1
0
        /// <summary>
        /// Handles Count Request
        /// </summary>
        /// <param name="db"></param>
        /// <param name="arg"></param>
        /// <returns></returns>
        protected dynamic HandleCountRequest(NancyBlackDatabase db, dynamic arg)
        {
            var entityName = (string)arg.table_name;
            var rows       = db.Count(entityName,
                                      this.Request.Query["$filter"],
                                      this.Request.Query["$orderby"],
                                      this.Request.Query["$skip"],
                                      this.Request.Query["$top"]);

            return(JToken.Parse(rows.ToString()));
        }
Esempio n. 2
0
        protected dynamic HandleCountWithoutSkipAndTakeRequest(NancyBlackDatabase db, dynamic arg)
        {
            // Count without Skip and Take
            var entityName = (string)arg.table_name;
            var rows       = db.Count(entityName,
                                      this.Request.Query["$filter"],
                                      this.Request.Query["$orderby"],
                                      null,
                                      null);

            return(JToken.Parse(rows.ToString()));
        }