Dotnet
Update User
  •  

Exercise - Exception Classes

PRO
Outline

Exercise: Create Exception Classes

Right from the start, let's begin with an exercise!

In the Conduit.Models Project

Create the following custom exceptions in the Exception namespace:
  • DuplicateEmailException
  • DuplicateUserNameException

Hint: Review the custom exceptions from prior exercises.

Create the a class called UpdateUser.cs in the Requests namespace with the following Properties:
 Visibility  |   Type     | Name     | Rules
=============================================================================================
   Public    |  String    | Email    | Valid Email, Max Length 50
   Public    |  String    | Password | Regex to Enforce: 1-Upper Case, 1-Lower Case, 1-Number
   Public    |  String    | UserName | Max Length 50
   Public    |  String    | Bio      | Max Length 200
   Public    |  String    | Image    | Max Length 200

Hint: Review the Register class to get an idea of how to implement the rules.

 

I finished! On to the next chapter