Dotnet
User Profile

Solution - Add Models And Exceptions

PRO
Outline

Solution: Adding Models & Exceptions

In the Conduit.Models Project:

Add a new class to the Exception namespace

Call ProfileNotFoundException

Here's the code to the ProfileNotFoundException.cs file:

using System;

namespace Conduit.Models.Exceptions
{
    public class ProfileNotFoundException : Exception
    {
        public ProfileNotFoundException(string message) : base(message) { }
    }
}
Add a new class to the Responses namespace

Called it UserProfile

•  with the following properties
Visibility  | Type   | Name
---------------------------------
  public    | string | UserName
  public    | string | Bio
  public    | string | Image
  public    | bool   | Following
Here's the code to the UserProfile.cs file:

namespace Conduit.Models.Responses
{
    public class UserProfile
    {
        public string UserName { get; set; }
        public string Bio { get; set; }
        public string Image { get; set; }
        public bool Following { get; set; }
    }

}

 

I finished! On to the next chapter