Dotnet
Authentication and Authorization - Login

Solution - Implement Interface

PRO

I finished! On to the next chapter

Outline

Solution: Implement Interface

In the Conduit.Repositories Project

Modify AccountRepository.cs file
  • Notice the error indicated on IAccountRepository
  • Hoever over it and select [Show Potential Fixes]
  • Select [Implement Interface]

Here's the code for AccountRepository.cs file:

using...

namespace Conduit.Repositories
{
    public class AccountRepository : IAccountRepository
    {
        private ConduitContext Context;
        private IMapper Mapper;
        private IConfiguration Configuration;
        private ILogger<AccountRepository> Logger;

        private async Task<Account> CreateAccountAsync(Register register)...

        private void CreatePasswordHash(string password, out byte[] passwordHash, out byte[] passwordSalt)...

        private async Task<bool> UserExistAsync(Register register)...

        private User CreateUser(Account account)...

        private string CreateToken(User user)...

        public async Task<User> RegisterUserAsync(Register register)...

        public async Task<User> LoginAsync(Login login)
        {
            throw new NotImplementedException();
        }

        public AccountRepository(ConduitContext context, IMapper mapper, IConfiguration configuration, ILogger<AccountRepository> logger)...
    }
}