/// <summary>
        /// 返却用のActionResultを作成します
        /// </summary>
        /// <param name="args">返却用データ</param>
        /// <returns>IHttpActionResult</returns>
        protected ActionResult CreateDefaultResult(ResponseArgs args)
        {
            ActionResult ret;

            if (args.Result)
            {
                ret = Ok(args.Model);
            }
            else
            {
                if (args.Model is HttpStatusCode code)
                {
                    ret = StatusCode((int)code);
                }
                else
                {
                    ret = StatusCode(StatusCodes.Status500InternalServerError);
                }
            }

            return(ret);
        }
Exemplo n.º 2
0
        /// <summary>
        /// 返却用のActionResultを作成します
        /// </summary>
        /// <param name="args">返却用データ</param>
        /// <returns>IHttpActionResult</returns>
        protected IHttpActionResult CreateDefaultResult(ResponseArgs args)
        {
            IHttpActionResult ret;

            if (args.Result)
            {
                ret = Ok(args.Model);
            }
            else
            {
                if (args.Model is HttpStatusCode code)
                {
                    ret = StatusCode(code);
                }
                else
                {
                    ret = InternalServerError();
                }
            }

            return(ret);
        }