File tree Expand file tree Collapse file tree 2 files changed +1
-66
lines changed Expand file tree Collapse file tree 2 files changed +1
-66
lines changed Original file line number Diff line number Diff line change 1
1
using Microsoft . Extensions . DependencyInjection ;
2
2
using Serilog . Ui . Core ;
3
- using Serilog . Ui . Web . Filters ;
4
3
using System ;
5
4
using System . Linq ;
6
5
7
6
namespace Serilog . Ui . Web
8
7
{
9
8
public static class ServiceCollectionExtensions
10
9
{
11
- public static IServiceCollection AddSerilogUi (
12
- this IServiceCollection services ,
13
- Action < SerilogUiOptionsBuilder > optionsBuilder
14
- )
10
+ public static IServiceCollection AddSerilogUi ( this IServiceCollection services , Action < SerilogUiOptionsBuilder > optionsBuilder )
15
11
{
16
12
if ( services == null )
17
13
throw new ArgumentNullException ( nameof ( services ) ) ;
@@ -22,24 +18,10 @@ Action<SerilogUiOptionsBuilder> optionsBuilder
22
18
var builder = new SerilogUiOptionsBuilder ( services ) ;
23
19
optionsBuilder . Invoke ( builder ) ;
24
20
25
- //var assemblies = AppDomain.CurrentDomain.GetAssemblies().Where(a => a.FullName.StartsWith("Serilog.Ui.Web")).ToList();
26
- //foreach (var assembly in assemblies)
27
- //{
28
- // if (assembly.FullName.Contains("Views"))
29
- // mvcBuilder.PartManager.ApplicationParts.Add(new CompiledRazorAssemblyPart(assembly));
30
- // else
31
- // {
32
- // mvcBuilder.PartManager.ApplicationParts.Add(new AssemblyPart(assembly));
33
- // var manifestResourceNames = assembly.GetManifestResourceNames();
34
- // }
35
- //}
36
-
37
21
var isAuthorizationFilterExist = services . Any ( s => s . ServiceType . FullName == typeof ( AuthorizationOptions ) . FullName ) ;
38
22
if ( ! isAuthorizationFilterExist )
39
23
services . AddScoped < AuthorizationOptions > ( ) ;
40
24
41
- services . AddScoped < AuthorizationFilter > ( ) ;
42
-
43
25
return services ;
44
26
}
45
27
}
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments