Example #1
0
 /// <summary>
 /// 获取ModelState的第一个错误信息
 /// </summary>
 /// <param name="modelState">modelState</param>
 /// <returns></returns>
 private static string FirstErrorMessage(this ModelStateDictionary modelState)
 {
     if (modelState == null || modelState.ErrorCount == 0)
     {
         return(null);
     }
     return(modelState.FirstModelErrorMessage());
 }