public class User
{
public long Id { get; set; }
public string Name { get; set; } = string.Empty;
public List<Content> Contents { get; set; } = new List<Content>(); // 用于连接文章 One To Many
}
Content.cs
public class Content
{
public long Id { get; set; }
public string Name { get; set; } = string.Empty;
public string Words { get; set; } = string.Empty;
public long UserId { get; set; } // 用于标识User Many To One
public User user { get; set; } // 用于直接使用user
}