コード例 #1
0
        public PaginatedList <AllAutomationsViewModel> View(
            [FromQuery(Name = "$filter")] string filter   = "",
            [FromQuery(Name = "$orderby")] string orderBy = "",
            [FromQuery(Name = "$top")] int top            = 100,
            [FromQuery(Name = "$skip")] int skip          = 0
            )
        {
            ODataHelper <AllAutomationsViewModel> oDataHelper = new ODataHelper <AllAutomationsViewModel>();

            var oData = oDataHelper.GetOData(HttpContext, oDataHelper);

            return(manager.GetAutomationsAndAutomationVersions(oData.Predicate, oData.PropertyName, oData.Direction, oData.Skip, oData.Take));
        }
コード例 #2
0
        public async Task <IActionResult> View(
            [FromQuery(Name = "$filter")] string filter   = "",
            [FromQuery(Name = "$orderby")] string orderBy = "",
            [FromQuery(Name = "$top")] int top            = 100,
            [FromQuery(Name = "$skip")] int skip          = 0
            )
        {
            try
            {
                ODataHelper <AllAutomationsViewModel> oDataHelper = new ODataHelper <AllAutomationsViewModel>();
                var oData = oDataHelper.GetOData(HttpContext, oDataHelper);

                return(Ok(_manager.GetAutomationsAndAutomationVersions(oData.Predicate, oData.PropertyName, oData.Direction, oData.Skip, oData.Take)));
            }
            catch (Exception ex)
            {
                return(ex.GetActionResult());
            }
        }