src/Library/NetPro.TypeFinder/FileServiceExtensions.cs
(完整代码) 1KBusing Microsoft.Extensions.DependencyInjection;
namespace System.NetPro
{
/// <summary>
///
/// </summary>
public static class FileServiceExtensions
{
/// <summary>
///
/// </summary>
/// <param name="services"></param>
/// <param name="typeFinderOption"></param>
/// <returns></returns>
public static IServiceCollection AddFileProcessService(this IServiceCollection services, TypeFinderOption typeFinderOption = null)
{
//services.AddSingleton(new TypeFinderOption { MountePath = typeFinderOption?.MountePath, CustomDllPattern = typeFinderOption?.CustomDllPattern });
if (typeFinderOption == null)
{
typeFinderOption = new TypeFinderOption { };
}
services.AddSingleton(typeFinderOption);
//var hostEnvironment = services.BuildServiceProvider().GetRequiredService<IHostEnvironment>();
//create default file provider
//CoreHelper.DefaultFileProvider = new NetProFileProvider(hostEnvironment);
//services.AddSingleton<ITypeFinder>(s => new WebAppTypeFinder());
services.AddSingleton<ITypeFinder, WebAppTypeFinder>();
//services.AddScoped<INetProFileProvider, NetProFileProvider>();
services.AddSingleton<INetProFileProvider, NetProFileProvider>();
return services;
}
}
}
24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明
AI 解读 AI
登录后可用,每次 10 算力,解读结果公开显示在下面。
还没有人解读过这个文件。