-
Notifications
You must be signed in to change notification settings - Fork 22
Expand file tree
/
Copy pathProxyUserManager.cs
More file actions
79 lines (65 loc) · 2.58 KB
/
ProxyUserManager.cs
File metadata and controls
79 lines (65 loc) · 2.58 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using HwProj.Models.AuthService.ViewModels;
using Microsoft.AspNetCore.Identity;
using Microsoft.EntityFrameworkCore;
namespace HwProj.AuthService.API.Services
{
public class ProxyUserManager : IUserManager
{
private readonly UserManager<UserViewModel> _aspUserManager;
public ProxyUserManager(UserManager<UserViewModel> aspUserManager)
{
_aspUserManager = aspUserManager;
}
public Task<IdentityResult> CreateAsync(UserViewModel userViewModel)
{
return _aspUserManager.CreateAsync(userViewModel);
}
public Task<IdentityResult> CreateAsync(UserViewModel userViewModel, string password)
{
return _aspUserManager.CreateAsync(userViewModel, password);
}
public Task<UserViewModel> FindByIdAsync(string id)
{
return _aspUserManager.FindByIdAsync(id);
}
public Task<UserViewModel> FindByEmailAsync(string email)
{
return _aspUserManager.FindByEmailAsync(email);
}
public Task<IdentityResult> UpdateAsync(UserViewModel userViewModel)
{
return _aspUserManager.UpdateAsync(userViewModel);
}
public Task<IdentityResult> AddToRoleAsync(UserViewModel userViewModel, string role)
{
return _aspUserManager.AddToRoleAsync(userViewModel, role);
}
public Task<IdentityResult> RemoveFromRoleAsync(UserViewModel userViewModel, string role)
{
return _aspUserManager.RemoveFromRoleAsync(userViewModel, role);
}
public Task<IList<string>> GetRolesAsync(UserViewModel userViewModel)
{
return _aspUserManager.GetRolesAsync(userViewModel);
}
public Task<bool> IsEmailConfirmedAsync(UserViewModel userViewModel)
{
return _aspUserManager.IsEmailConfirmedAsync(userViewModel);
}
public Task<bool> CheckPasswordAsync(UserViewModel userViewModel, string password)
{
return _aspUserManager.CheckPasswordAsync(userViewModel, password);
}
public Task<IdentityResult> ChangePasswordAsync(UserViewModel userViewModel, string currentPassword, string newPassword)
{
return _aspUserManager.ChangePasswordAsync(userViewModel, currentPassword, newPassword);
}
public Task<IList<UserViewModel>> GetUsersInRoleAsync(string role)
{
return _aspUserManager.GetUsersInRoleAsync(role);
}
}
}