public static void AddPrerequisites(this ModelBuilder builder, IEnumerable <Prerequisite> prerequisites, Func <BasePrerequisiteBinding> createBinding)
        {
            foreach (Prerequisite prerequisite in prerequisites)
            {
                BasePrerequisiteBinding binding = createBinding.Invoke();
                binding.Id = prerequisite.Id;

                builder.AddPrerequisite(prerequisite, binding);
            }
        }
        public static void AddPrerequisite(this ModelBuilder builder, Prerequisite prerequisite, BasePrerequisiteBinding binding)
        {
            binding.PrerequisiteId = prerequisite.Id;
            prerequisite.BindingId = binding.Id;

            builder.AddData(binding.GetType(), binding);

            switch (prerequisite)
            {
            case ChoicePrerequisite choicePrerequisite:
                foreach (Prerequisite innerPrerequisite in choicePrerequisite.Choices)
                {
                    builder.AddPrerequisite(innerPrerequisite, new ChoicePrerequisiteBinding {
                        Id = innerPrerequisite.Id, ChoiceId = choicePrerequisite.Id
                    });
                }

                choicePrerequisite.Choices = Array.Empty <Prerequisite>();
                break;

            case CombinedPrerequisite combinedPrerequisite:
                foreach (Prerequisite innerPrerequisite in combinedPrerequisite.Entries)
                {
                    builder.AddPrerequisite(innerPrerequisite, new CombinedPrerequisiteBinding {
                        Id = innerPrerequisite.Id, CombinationId = combinedPrerequisite.Id
                    });
                }
                combinedPrerequisite.Entries = Array.Empty <Prerequisite>();
                break;
            }

            builder.Entity(prerequisite.GetType()).HasData(prerequisite);
        }