Circular reference in domain model using c# struct
问题 What happens when there is a circular reference between two structs? How does memory allocation work for the example below or would it yield and error? public struct MultipleChoiceQuestion { public IEnumerable<Option> Options; } public struct Option { public MultipleChoiceQuestion Question; } 回答1: The Options field in MultipleChoiceQuestion is just a reference here, which will be null by default. The Question field in Option is a value of type MultipleChoiceQuestion which will have its