分支自 SuZhouGuanHong/TaiYuanTaiZhong

huanghongfeng
2024-06-25 b9f5657fc9a083238a1a27ef35ef885f1e912b4f
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.ModelBinding.Validation;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using System.Text;
using WIDESEA_Core.Extensions;
using WIDESEA_Core.Filters;
 
namespace WIDESEA_Core.ObjectActionValidator
{
    public class NullObjectModelValidator : IObjectModelValidator
    {
 
        public void Validate(
           ActionContext actionContext,
           ValidationStateDictionary validationState,
           string prefix,
           object model)
        {
            if (string.IsNullOrEmpty(prefix))
            {
                actionContext.ModelValidator(prefix, model);
                return;
            }
        }
    }
}