ここで外部キーを別の名前に関連付けるにはどうすればよいですか:createdbyinpostとUserIDinusersテーブル。
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; }
}