Skip to content

resolve cyclical dependency issue #4

@iskandarem

Description

@iskandarem
class First : BaseEquatable
    {
        public int Id { get; set; }
        public string Name { get; set; }
        public Second Second{ get; set; }
        public override List<object?> Props => [Id, Name, Second];

        public override bool? Stringify => true;
    }
    class Second : BaseEquatable
    {
        public int Id { get; set; }
        public string Name { get; set; }
        public First First { get; set; }

        public override List<object?> Props => [Id, Name, First];

        public override bool? Stringify => true;
    }

then in programm.cs something like:

First first = new First();
Second second = new Second();
first.Second = second;
second.first = first;

Console.Writeline(first.Equals(second)); // throws an error;

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions