Created
August 11, 2019 21:51
-
-
Save xsoheilalizadeh/5bcf4c079ba823649c8423d35990dbe0 to your computer and use it in GitHub Desktop.
ASP.NET Core Identity
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public class CustomUserStore : IUserStore<IdentityUser<int>> | |
| { | |
| private readonly List<IdentityUser<int>> _users; | |
| public CustomUserStore() | |
| { | |
| _users = new List<IdentityUser<int>>(); | |
| } | |
| public Task<IdentityResult> CreateAsync(IdentityUser<int> user, CancellationToken cancellationToken) | |
| { | |
| _users.Add(user); | |
| return Task.FromResult(IdentityResult.Success); | |
| } | |
| public Task<IdentityUser<int>> FindByNameAsync(string normalizedUserName, CancellationToken cancellationToken) | |
| { | |
| return Task.FromResult(_users.SingleOrDefault(u => u.NormalizedUserName == normalizedUserName)); | |
| } | |
| /// more methods | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment