@@ -22,81 +22,81 @@ public Startup(IConfiguration configuration)
22
22
23
23
public IConfiguration Configuration { get ; }
24
24
25
- //1.AspectCore
26
- public IServiceProvider ConfigureServices ( IServiceCollection services )
27
- {
28
- services . AddScoped < IAspectCoreService , AspectCoreService > ( ) ;
25
+ //// 1.AspectCore
26
+ // public IServiceProvider ConfigureServices(IServiceCollection services)
27
+ // {
28
+ // services.AddScoped<IAspectCoreService, AspectCoreService>();
29
29
30
- // services.AddDefaultInMemoryCache();
31
- services . AddDefaultRedisCache ( options =>
32
- {
33
- options . DBConfig = new RedisDBOptions { Configuration = "localhost" } ;
34
- } ) ;
30
+ // services.AddDefaultInMemoryCache();
31
+ // // services.AddDefaultRedisCache(options =>
32
+ // // {
33
+ // // options.DBConfig = new RedisDBOptions { Configuration = "localhost" };
34
+ // // });
35
35
36
- services . AddMvc ( ) . SetCompatibilityVersion ( CompatibilityVersion . Version_2_1 ) ;
36
+ // services.AddMvc().SetCompatibilityVersion(CompatibilityVersion.Version_2_1);
37
37
38
- //1.1. all default
39
- return services . ConfigureAspectCoreInterceptor ( ) ;
38
+ // //1.1. all default
39
+ // return services.ConfigureAspectCoreInterceptor();
40
40
41
- //1.2. default and customize
42
- //Action<IServiceContainer> action = x =>
43
- //{
44
- // x.AddType<IAspectCoreService, AspectCoreService>();
45
- //};
41
+ // //1.2. default and customize
42
+ // //Action<IServiceContainer> action = x =>
43
+ // //{
44
+ // // x.AddType<IAspectCoreService, AspectCoreService>();
45
+ // //};
46
46
47
- //return services.ConfigureAspectCoreInterceptor(action);
47
+ // //return services.ConfigureAspectCoreInterceptor(action);
48
48
49
- //1.3. all customize
50
- //Action<IServiceContainer> action = x =>
51
- //{
52
- // x.AddType<IDateTimeService, DateTimeService>();
53
- // x.Configure(config =>
54
- // {
55
- // config.Interceptors.AddTyped<EasyCachingInterceptor>(method => typeof(Core.Internal.IEasyCaching).IsAssignableFrom(method.DeclaringType));
56
- // });
57
- //};
49
+ // //1.3. all customize
50
+ // //Action<IServiceContainer> action = x =>
51
+ // //{
52
+ // // x.AddType<IDateTimeService, DateTimeService>();
53
+ // // x.Configure(config =>
54
+ // // {
55
+ // // config.Interceptors.AddTyped<EasyCachingInterceptor>(method => typeof(Core.Internal.IEasyCaching).IsAssignableFrom(method.DeclaringType));
56
+ // // });
57
+ // //};
58
58
59
- //return services.ConfigureAspectCoreInterceptor(action, true);
60
- }
59
+ // //return services.ConfigureAspectCoreInterceptor(action, true);
60
+ // }
61
61
62
- //// 2. Castle
63
- // public IServiceProvider ConfigureServices(IServiceCollection services)
64
- // {
65
- // services.AddMvc();
62
+ //2. Castle
63
+ public IServiceProvider ConfigureServices ( IServiceCollection services )
64
+ {
65
+ services . AddMvc ( ) ;
66
66
67
- // services.AddTransient<ICastleService, CastleService>();
67
+ services . AddTransient < ICastleService , CastleService > ( ) ;
68
68
69
- // services.AddDefaultInMemoryCache();
69
+ services . AddDefaultInMemoryCache ( ) ;
70
70
71
- // //2.1. all default
72
- // return services.ConfigureCastleInterceptor();
71
+ //2.1. all default
72
+ return services . ConfigureCastleInterceptor ( ) ;
73
73
74
- // //2.2. default and customize
75
- // //Action<ContainerBuilder> action = x =>
76
- // //{
77
- // // x.RegisterType<CastleService>().As<ICastleService>();
78
- // //};
74
+ //2.2. default and customize
75
+ //Action<ContainerBuilder> action = x =>
76
+ //{
77
+ // x.RegisterType<CastleService>().As<ICastleService>();
78
+ //};
79
79
80
- // //return services.ConfigureCastleInterceptor(action);
80
+ //return services.ConfigureCastleInterceptor(action);
81
81
82
- // //2.3. all customize
83
- // //Action<ContainerBuilder> action = x =>
84
- // //{
85
- // // x.RegisterType<DateTimeService>().As<IDateTimeService>();
82
+ //2.3. all customize
83
+ //Action<ContainerBuilder> action = x =>
84
+ //{
85
+ // x.RegisterType<DateTimeService>().As<IDateTimeService>();
86
86
87
- // // var assembly = Assembly.GetExecutingAssembly();
88
- // // x.RegisterType<EasyCachingInterceptor>();
87
+ // var assembly = Assembly.GetExecutingAssembly();
88
+ // x.RegisterType<EasyCachingInterceptor>();
89
89
90
- // // x.RegisterAssemblyTypes(assembly)
91
- // // .Where(type => typeof(Core.Internal.IEasyCaching).IsAssignableFrom(type) && !type.GetTypeInfo().IsAbstract)
92
- // // .AsImplementedInterfaces()
93
- // // .InstancePerLifetimeScope()
94
- // // .EnableInterfaceInterceptors()
95
- // // .InterceptedBy(typeof(EasyCachingInterceptor));
96
- // //};
90
+ // x.RegisterAssemblyTypes(assembly)
91
+ // .Where(type => typeof(Core.Internal.IEasyCaching).IsAssignableFrom(type) && !type.GetTypeInfo().IsAbstract)
92
+ // .AsImplementedInterfaces()
93
+ // .InstancePerLifetimeScope()
94
+ // .EnableInterfaceInterceptors()
95
+ // .InterceptedBy(typeof(EasyCachingInterceptor));
96
+ //};
97
97
98
- // //return services.ConfigureCastleInterceptor(action, true);
99
- // }
98
+ //return services.ConfigureCastleInterceptor(action, true);
99
+ }
100
100
101
101
public void Configure ( IApplicationBuilder app , IHostingEnvironment env )
102
102
{
0 commit comments