"Partial Methods"

// File: ExampleClass.Alpha.cs

public partial class ExampleClass {
	public void Print() => DoThing();

	partial void DoThing() {
		Console.WriteLine("AAA");
	}
}





// File: ExampleClass.Beta.cs

public partial class ExampleClass {
	partial void DoThing() {
		Console.WriteLine("BBB");
	}
}




// Elsewhere

static void Test() {
	var ec = new ExampleClass();
	
	ec.Print(); // Prints AAA and BBB to console (order unspecified).
}


Code snippet taken from "Complete C# Quick Reference - C# 2, 3 and 4".