mirror of
https://github.com/BeyondDimension/SteamTools.git
synced 2026-10-22 01:16:17 +08:00
22 lines
743 B
C#
22 lines
743 B
C#
using System.Diagnostics.CodeAnalysis;
|
|
|
|
namespace System.Application.Services
|
|
{
|
|
/// <summary>
|
|
/// 模型验证
|
|
/// </summary>
|
|
public interface IModelValidator
|
|
{
|
|
/// <summary>
|
|
/// 验证模型,返回结果以及错误消息
|
|
/// </summary>
|
|
/// <param name="model"></param>
|
|
/// <param name="errorMessage"></param>
|
|
/// <param name="ignores"></param>
|
|
/// <returns></returns>
|
|
bool Validate(object model, [NotNullWhen(false)] out string? errorMessage, params Type[] ignores);
|
|
|
|
/// <inheritdoc cref="Validate(object, out string?, Type[])"/>
|
|
public bool Validate(object model, params Type[] ignores) => Validate(model, out var _, ignores);
|
|
}
|
|
} |