Пример #1
0
        public static ModuleBuilder CreateModule(Action <AssemblySpecification> assemblySpecificationExpression)
        {
            var assemblySpec = new AssemblySpecification();

            assemblySpecificationExpression(assemblySpec);

            AssemblyBuilder assemblyBuilder = CreateAssembly(assemblySpec);

            foreach (var assemblyAttribute in assemblySpec.AttributeSpecification)
            {
                assemblyBuilder.AddAttribute(assemblyAttribute.GetType());
            }

            return(assemblyBuilder.DefineDynamicModule(assemblySpec.Name, assemblySpec.Name + ".dll"));
        }