コード例 #1
0
        /// <summary>
        /// 添加错误码
        /// </summary>
        /// <typeparam name="T"></typeparam>
        /// <typeparam name="TProperty"></typeparam>
        /// <param name="rule"></param>
        /// <param name="errorMessage"></param>
        /// <returns></returns>
        public static IRuleBuilderOptions <T, TProperty> WithStatusCode <T, TProperty>(this IRuleBuilderOptions <T, TProperty> rule,
                                                                                       StatusCode statusCode, params object[] formatParameters)
        {
            var response = NGPResponse.Create(statusCode, formatParameters);

            return(rule.WithMessage(response.ToString()));
        }
コード例 #2
0
 /// <summary>
 /// 重写OK方法
 /// </summary>
 /// <returns></returns>
 protected OkObjectResult OkResult()
 {
     return(Ok(NGPResponse.Create()));
 }