I want to assign an object of one class to another class by constructor, and retrieve the values of the class assigned by constructor from the class which has the constructor. Sounds confusing, it is too :). Can't handle it. Do you have any ideas? Here is an example code.
public class Class1 { public class1(int value1) { Value1 = value1; } public int Value1 { get;} } public class Class2 { public object Object1 {get; set;} } public class main { Class1 TestClass = new Class1(15); Class2 TestClass1 = new Class2(); public void main() { TestClass1.Object1 = TestClass(); //Now I want to this Console.WriteLine(TestClass1.Object1.Value1); TestClass1.Object1.Value1; } }