<commit_before>﻿using System.Collections.Generic;
using System.Web.Mvc;
using Abp.Web.Localization;
using Abp.Web.Models;

namespace Abp.Web.Mvc.Models
{
    public static class ModelStateExtensions
    {
        public static MvcAjaxResponse ToMvcAjaxResponse(ModelStateDictionary modelState)
        {
            if (modelState.IsValid)
            {
                return new MvcAjaxResponse();
            }

            var validationErrors = new List<ValidationErrorInfo>();

            foreach (var state in modelState)
            {
                foreach (var error in state.Value.Errors)
                {<commit_msg>Fixed #1140: Added this to ToMvcAjaxResponse extension method.<commit_after>﻿using System.Collections.Generic;
using System.Web.Mvc;
using Abp.Web.Localization;
using Abp.Web.Models;

namespace Abp.Web.Mvc.Models
{
    public static class ModelStateExtensions
    {
        public static MvcAjaxResponse ToMvcAjaxResponse(this ModelStateDictionary modelState)
        {
            if (modelState.IsValid)
            {
                return new MvcAjaxResponse();
            }

            var validationErrors = new List<ValidationErrorInfo>();

            foreach (var state in modelState)
            {
                foreach (var error in state.Value.Errors)
                {
{'fraction_non_alphanumeric': 0.07218844984802432, 'fraction_numerical': 0.00303951367781155, 'mean_word_length': 2.1208530805687205, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3951371', 'n_tokens_mistral': 347, 'n_tokens_neox': 340, 'n_words': 84}