using System;
class FirstClass
{
public int Value { get; set; }
}
class SecondClass
{
public FirstClass First { get; set; }
public void ChangeValue(int newValue)
{
First.Value = newValue;
}
}
class Program
{
static void Main(string[] args)
{
var first = new FirstClass();
var second = new SecondClass();
second.First = first;
second.ChangeValue(42);
Console.WriteLine(first.Value); // Выведет 42
}
}