/// <summary>
        /// Generates a compatible Compiled Definition from the class info.
        /// </summary>
        /// <param name="classInfo">The class info to generate.</param>
        /// <returns>The class's C# code.</returns>
        public static string Generate(ClassInfo classInfo)
        {
            bool additionalParametersForClassDefined =
                classInfo.AdditionalParametersForMethods.Any(x => x.Equals(ClassInfo.AdditionalParamtersForClassMethod, StringComparison.Ordinal));

            bool classAddParams = additionalParametersForClassDefined || classInfo.UsesAdditionalParametersForHoldingClass;

            ClassWriter sb = new ClassWriter(
                new ClassDefinition(classInfo.Namespace, classInfo.TypeName)
            {
                Nullable = true,
                Partial  = true,
                Usings   = Usings,
            });

            FieldDefinitions(sb, classInfo);
            CompileMethod(sb, classInfo);
            AttachMethod(sb, classInfo);
            CombinedAdditionalParametersForClass(sb, additionalParametersForClassDefined);
            CombinedVariableTypeReassignments(sb, classInfo.TypeOfMethods);

            foreach (var prop in classInfo.CompiledProps)
            {
                IsComplexProperty(sb, prop);
            }

            foreach (var prop in classInfo.CompiledDictionaryProps)
            {
                IsComplexProperty(sb, prop);
            }

            foreach (var prop in classInfo.CompiledProps)
            {
                EvalConditionMethod(sb, prop, classInfo.AdditionalParametersForMethods, classAddParams);
            }

            foreach (var prop in classInfo.CompiledDictionaryProps)
            {
                EvalDictionaryConditionMethod(sb, prop, classInfo.AdditionalParametersForMethods, classAddParams);
            }

            foreach (var prop in classInfo.CompiledProps)
            {
                GetParametersMethod(sb, prop, classInfo.AdditionalParametersForMethods, classAddParams);
            }

            foreach (var prop in classInfo.CompiledDictionaryProps)
            {
                GetParametersMethod(sb, prop, classInfo.AdditionalParametersForMethods, classAddParams);
            }

            return(sb.ToString());
        }