📜  asp.net core api 检测到属性的自引用循环 - C# 代码示例

📅  最后修改于: 2022-03-11 14:49:18.045000             🧑  作者: Mango

代码示例1
public class StaffMember
{
    public string FirstName { get; set; }
    public virtual Department Department { get; set; }
}

public class Department
{
    public string DepartmentName { get; set; }
    [JsonIgnore]
    public virtual ICollection StaffMembers { get; set; }
}