How can I associate a foreign key with different names here: createdby in post and UserID in users table.
public class Post : IValidatableObject
{
[Key]
public long PostID { get; set; }
public long? ParentPostID { get; set; }
[ForeignKey("CreatedBy")]
public virtual User Users { get; set; }
[ScaffoldColumn(false)]
public DateTime? CreatedDate { get; set; }
[ScaffoldColumn(false)]
public long? CreatedBy { get; set; }
}
public class User
{
[Key]
public long UserID { get; set; }
[Required]
[MaxLength(20)]
[Display(Name = "User Name")]
public string UserName { get; set; }
}