diff options
author | crupest <crupest@outlook.com> | 2020-01-30 20:26:52 +0800 |
---|---|---|
committer | crupest <crupest@outlook.com> | 2020-01-30 20:26:52 +0800 |
commit | 79ab2b304d93b1029515bd3f954db4e5a73f4168 (patch) | |
tree | 538ceea06640f501d2a950cac813c10561036e4d /Timeline/Startup.cs | |
parent | dd0097af5c4ccbe25a1faca2286d729c93fd4116 (diff) | |
download | timeline-79ab2b304d93b1029515bd3f954db4e5a73f4168.tar.gz timeline-79ab2b304d93b1029515bd3f954db4e5a73f4168.tar.bz2 timeline-79ab2b304d93b1029515bd3f954db4e5a73f4168.zip |
...
Diffstat (limited to 'Timeline/Startup.cs')
-rw-r--r-- | Timeline/Startup.cs | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/Timeline/Startup.cs b/Timeline/Startup.cs index 091a16e5..998b5c44 100644 --- a/Timeline/Startup.cs +++ b/Timeline/Startup.cs @@ -1,3 +1,4 @@ +using AutoMapper;
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Hosting;
using Microsoft.AspNetCore.HttpOverrides;
@@ -47,7 +48,6 @@ namespace Timeline });
services.Configure<JwtConfig>(Configuration.GetSection(nameof(JwtConfig)));
- var jwtConfig = Configuration.GetSection(nameof(JwtConfig)).Get<JwtConfig>();
services.AddAuthentication(AuthenticationConstants.Scheme)
.AddScheme<MyAuthenticationOptions, MyAuthenticationHandler>(AuthenticationConstants.Scheme, AuthenticationConstants.DisplayName, o => { });
services.AddAuthorization();
@@ -75,16 +75,14 @@ namespace Timeline });
}
- services.AddLocalization(options =>
- {
- options.ResourcesPath = "Resources";
- });
+ services.AddAutoMapper(GetType().Assembly);
+
+ services.AddTransient<IClock, Clock>();
+ services.AddTransient<IPasswordService, PasswordService>();
services.AddScoped<IUserService, UserService>();
services.AddScoped<IUserTokenService, JwtUserTokenService>();
services.AddScoped<IUserTokenManager, UserTokenManager>();
- services.AddTransient<IPasswordService, PasswordService>();
- services.AddTransient<IClock, Clock>();
services.AddUserAvatarService();
services.AddScoped<IPersonalTimelineService, PersonalTimelineService>();
|