public static ApiResult AsApiResult(this System.Web.Http.ModelBinding.ModelStateDictionary modelState, int code = 7001) { return(new ApiResult(code, modelState.GetFirstError())); }