public class BodyPhoto
{
[Key]
public int PhotoID { get; set; }
public int UserID { get; set; }
public virtual User User { get; set; }
public DateTime Date { get; set; }
public string PhotoSource { get; set; }
public string MuscleGroup { get; set; }
}
I want to have a web api for this. User login to the website, and has unique UserID. User does a post with BodyPhoto. How can i make sure i save BodyPhoto with correct UserID.
I am confused how to implement this with asp.net web api. Maybe with sessions and authentication filters.