コード例 #1
0
        public async Task <IActionResult> GetGiftCards([FromBody] ODataActionParameters parameters)
        {
            if (!parameters.ContainsKey("startDate"))
            {
                parameters.Add("startDate", RequiredErrorMessage);
                return(new BadRequestObjectResult(parameters));
            }

            if (!parameters.ContainsKey("endDate"))
            {
                parameters.Add("endDate", RequiredErrorMessage);
                return(new BadRequestObjectResult(parameters));
            }

            var startDate = (DateTimeOffset)parameters["startDate"];
            var endDate   = (DateTimeOffset)parameters["endDate"];

            var result = await Command <GetGiftCardsCommand>().Process(CurrentContext, startDate, endDate);

            return(new ObjectResult(result));
        }