copy an attribute of a property from one instance to another instance (of a different type ) at runt
- by Omu
let's say I have 2 classes like this:
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
is it possible to copy the attributes from foo to bar at run-time ?