1
This commit is contained in:
29
iMES.Core/ObjectActionValidator/NullObjectModelValidator.cs
Normal file
29
iMES.Core/ObjectActionValidator/NullObjectModelValidator.cs
Normal file
@@ -0,0 +1,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 iMES.Core.Extensions;
|
||||
using iMES.Core.Filters;
|
||||
|
||||
namespace iMES.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;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user