Ich habe eine Klasse:C# Immobilie mit generischem Typ
public class class1
{
public string Property1 {get;set;}
public int Property2 {get;set;}
}
Welche instanziiert werden:
var c = new class1();
c.Property1 = "blah";
c.Property2 = 666;
Also bei mir tragen (ich bin neu in Generika), muß ich eine andere Klasse mit einem
public class Class2
{
public GenericType Property3 {get;set;}
}
ich möchte in der Lage sein: Eigenschaft eines generischen Typs, so dass Property1 oder Property2 kann eingestellt property3 verwendet werden
var c2 = new class2();
c2.Property3 = c1.Property2 // Any property of any type.
siehe diese Antwort: http://stackoverflow.com/questions/271347/making-a-generic-property –
Vielen Dank für den Link. – youwhut