I have a web page that allows user to sign petitions, in the user detail page I want to display the petitions the user has signed, including the petition image. The image is specific to the category of the petition.

I have a category model that holds the image

public class Category
{
    public int CategoryID { get; set; }
    public string Name { get; set;}
    public string catImage { get; set; }
    public ICollection<Cause> Causes { get; set; }
}

Then I have a cause model that links to the Category through CategoryID

public class Cause
{
    public int CauseID { get; set; }
    public string Title { get; set; }
    public string Description { get; set; }
    public int UserID { get; set; }
    public string createdBy { get; set; }
    public DateTime createdOn { get; set; }
    public int Target { get; set; }
    public int CategoryID { get; set; }
    public virtual ICollection<Signature> Signatures { get; set; }
    public Category Category { get; set; }
}

Then a signature model that links the Cause to the User

public class Signature
{
    public int SignatureID { get; set; }
    public int CauseID { get; set; }
    public int UserID { get; set; }
    public DateTime signedOn { get; set; }

    public virtual Cause Cause { get; set; }
    public virtual User User { get; set; }

}

And finally a user model

public class User
{
    public int ID { get; set; }
    public string Username { get; set; }
    public string Email { get; set; }
    public string Password { get; set; }
    public string UserImage { get; set; }
    public Role Role { get; set; }
    public virtual ICollection<Signature> Signatures { get; set; }
}

On the user details page I am trying to display a table with a list of all the petitions the user has signed. I have been able to show the name and the date shown, but not the images.
I would really appreciated any help. Thanks

0 Answers