ILCode for newobj by creating a new custom Type
AssemblyName _assemblyName = new AssemblyName(); _assemblyName.Name = "newObj"; AssemblyBuilder _assemblyBuilder = Thread.GetDomain().DefineDynamicAssembly(_assemblyName, AssemblyBuilderAccess.RunAndSave); ModuleBuilder _modBuilder = _assemblyBuilder.DefineDynamicModule(_assemblyName.Name + ".exe"); TypeBuilder _typeBuilder = _modBuilder.DefineType(" ILCode.Program"); TypeBuilder _customType = _modBuilder.DefineType("ILCode.myCustomType", TypeAttributes.Public); Type[] arg = { typeof(string) }; ConstructorBuilder _customTypeConstructor = _customType.DefineConstructor(MethodAttributes.Public, CallingConventions.Standard, arg); PropertyBuilder _prop1 = _customType.DefineProperty("MyId", PropertyAttributes.None, typeof(int), new Type[0]); PropertyBuilder _prop2 = _customType.DefineProperty("MyName", PropertyAttributes.None,