I have a Holiday table and a User table.
The Holiday table has columns RequesterID and AuthorisedByID, which both link to the primary key of the User table.
This is my Holiday model:
public class Holiday
{
[Key]
[DatabaseGenerated(DatabaseGeneratedOption.Identity)]
public Guid HolidayId { get; set; }
[ForeignKey("UserId")]
public virtual User User { get; set; }
public Guid RequesterId { get; set; }
public Guid? AuthorisedById { get; set; }
}
I am unable to declare the AuthorisedByID as a foreign key in the User table just like I think I did with RequesterId column.
I wonder if you can give me some hints on how to resolve.
Thanks.