Omu*_*Omu 2 c# reflection reflection.emit
假设我有2个这样的类:
public class Foo
{
[Required]
public string Name {get;set;}
}
public class Bar
{
// put here [Required] at run-time
public string Name {get;set;}
}
var foo = new Foo();
var bar = new Bar();
//copy the required from foo to bar
Run Code Online (Sandbox Code Playgroud)
是否可以在运行时将属性从foo复制到bar?