"Managed Function Pointers"

public class User {
	public string Name { get; set; }
	public int Age { get; set; }

	public void ClearUserDetails() {
		Name = "<cleared>";
		Age = 0;
	}
}

public static class Database {
	public static int ClearAllRecords(string idPrefix) => idPrefix.Length;

	public static void ClearUserDetails(User u) => u.ClearUserDetails();
}

// ...

unsafe {
	delegate* managed<string, int> databaseClearFuncPtr = &Database.ClearAllRecords;
	Console.WriteLine(databaseClearFuncPtr("Testing")); // Prints '7' on console

	var user = new User { Name = "Ben", Age = 31 };
	delegate* managed<User, void> userClearFuncPtr = &Database.ClearUserDetails;
	userClearFuncPtr(user);
	Console.WriteLine($"User: {user.Name} / {user.Age}"); // Prints 'User: <cleared> / 0' on console
}


Code snippet taken from "Two Decades of C#: A Reference - C# 9".