File tree Expand file tree Collapse file tree 1 file changed +26
-1
lines changed
Pek.AspNetCore/Infrastructure Expand file tree Collapse file tree 1 file changed +26
-1
lines changed Original file line number Diff line number Diff line change 1
- using NewLife . Model ;
1
+ using Microsoft . AspNetCore . Mvc . Infrastructure ;
2
+ using Microsoft . Extensions . DependencyInjection . Extensions ;
3
+
4
+ using NewLife . Model ;
5
+
6
+ using Pek . ResumeFileResult ;
7
+ using Pek . ResumeFileResult . Executor ;
2
8
3
9
namespace Pek . Infrastructure ;
4
10
11
+ /// <summary>
12
+ /// 依赖注入ServiceCollection容器扩展方法
13
+ /// </summary>
5
14
public static class ServiceCollectionExtensions
6
15
{
7
16
/// <summary>
@@ -48,4 +57,20 @@ public static void AddAllSingletons(this IServiceCollection services)
48
57
49
58
ObjectContainer . Provider = services . BuildServiceProvider ( ) ;
50
59
}
60
+
61
+ /// <summary>
62
+ /// 注入断点续传服务
63
+ /// </summary>
64
+ /// <param name="services"></param>
65
+ /// <returns></returns>
66
+ public static IServiceCollection AddResumeFileResult ( this IServiceCollection services )
67
+ {
68
+ services . TryAddSingleton < IActionResultExecutor < ResumePhysicalFileResult > , ResumePhysicalFileResultExecutor > ( ) ;
69
+ services . TryAddSingleton < IActionResultExecutor < ResumeVirtualFileResult > , ResumeVirtualFileResultExecutor > ( ) ;
70
+ services . TryAddSingleton < IActionResultExecutor < ResumeFileStreamResult > , ResumeFileStreamResultExecutor > ( ) ;
71
+ services . TryAddSingleton < IActionResultExecutor < ResumeFileContentResult > , ResumeFileContentResultExecutor > ( ) ;
72
+ return services ;
73
+ }
74
+
75
+
51
76
}
You can’t perform that action at this time.
0 commit comments