A FK to itself lead to autopoco loop forever

Mar 20, 2014 at 3:30 AM
namespace apple
public class AgencyInformation
    [Key, DatabaseGenerated(DatabaseGeneratedOption.Identity)]
    public int Id { get; set; }

    public Nullable<int> ParentAgencyID { get; set; }

    public virtual AgencyInformation AgencyInformationParent { get; set; }


I have a entity class (entity framework). It has a FK to itself. When I use autopoco to generate "AgencyInformation", my vs has to restart...

As I understand, autopoco will generate the data for FK. If the FK has a loop( a FK to itself), autopoc can not stop. Is there any way to close the function that generate data for FK?

thank you