I created a dll
file and added a class inside that like what you see here:
using (CSharpCodeProvider codeProvider = new CSharpCodeProvider())
{
System.CodeDom.Compiler.CompilerParameters parameters = new CompilerParameters();
parameters.GenerateExecutable = false;
parameters.OutputAssembly = "Per.dll";
CompilerResults results = codeProvider.CompileAssemblyFromSource(parameters, "public class PersonVM{ " + "public int id{get;set;}" +
"public string Name{get;set;}" + "public string LName{get;set;}" + "public string LNamee2 { get; set; }" + "public string L4 { get; set; }" + " }");
}
now whats the standard solution to changing the PersonVM class inside Per.dll
? what's your Idea about that?
For describe: i'm using Asp.Net MVC5. and my final purpose is generating my view model classes at run time.
tell me if you have any other solution and ideas
Aucun commentaire:
Enregistrer un commentaire