mirror of
https://github.com/BeyondDimension/SteamTools.git
synced 2026-10-21 17:13:09 +08:00
21 lines
683 B
C#
21 lines
683 B
C#
using Microsoft.Extensions.DependencyInjection.Extensions;
|
|
using System.Application.Services;
|
|
using System.Application.Services.Implementation;
|
|
|
|
// ReSharper disable once CheckNamespace
|
|
namespace Microsoft.Extensions.DependencyInjection
|
|
{
|
|
public static class ServiceCollectionExtensions
|
|
{
|
|
/// <summary>
|
|
/// 尝试添加模型验证
|
|
/// </summary>
|
|
/// <param name="services"></param>
|
|
/// <returns></returns>
|
|
public static IServiceCollection TryAddModelValidator(this IServiceCollection services)
|
|
{
|
|
services.TryAddSingleton<IModelValidator, ModelValidator>();
|
|
return services;
|
|
}
|
|
}
|
|
} |