Dotnet
Current User

Exercise - AccountRepository Implement Interface

PRO
Outline

Exercise: Implement Interface

In the Conduit.Repository Project

Modify AccountRepository.cs by Implementing the IAccountRepository Interface
  • Hover over the error on IAccountRepository
  • Select [Show Potential Fixes]
  • Select [Implement interface]

Modify the GetCurrentuserAsync Method by adding the following code

Account account = await GetLoggedInUser(); // We'll implement this in the next demo
if (account is null)
{
   throw new InvalidCredentialsException("Invalid user - Please login using a valid email & password");
}
return CreateUser(account); // We get to reuse an existing method. Yay!!!
 

I finished! On to the next chapter