What is the best way to merge two objects during runtime using C#?
问题 I have two objects and I want to merge them: public class Foo { public string Name { get; set; } } public class Bar { public Guid Id { get; set; } public string Property1 { get; set; } public string Property2 { get; set; } public string Property3 { get; set; } public string Property4 { get; set; } } To create: public class FooBar { public string Name { get; set; } public Guid Id { get; set; } public string Property1 { get; set; } public string Property2 { get; set; } public string Property3 {