public static GeneratedAssembly AssembleTypes(this ICodeFileCollection generator, GenerationRules rules) { var generatedAssembly = generator.StartAssembly(rules); foreach (var file in generator.BuildFiles()) { file.AssembleTypes(generatedAssembly); } return(generatedAssembly); }
private string generateCode(ICodeFileCollection collection) { if (collection.ChildNamespace.IsEmpty()) { throw new InvalidOperationException($"Missing {nameof(ICodeFileCollection.ChildNamespace)} for {collection}"); } var @namespace = collection.ToNamespace(collection.Rules); var generatedAssembly = new GeneratedAssembly(collection.Rules, @namespace); var files = collection.BuildFiles(); foreach (var file in files) { file.AssembleTypes(generatedAssembly); } return(generatedAssembly.GenerateCode(ServiceVariableSource)); }