Demo2

CSharp · Console

/Program.cs

using System;

public class Program
{
	public static void Main()
	{
		Console.WriteLine("Demo is going to be created");
		var d = new Demo();
		Console.WriteLine("Demo has been created");
	}
}

public class Demo
{
	public Demo()
	{
		Console.WriteLine("Running constructor");
		action = CreateAction();
	}

	private IService _service;
	
	Action<Guid> action;
	
	public Action<Guid> CreateAction() // Now it does not need to be "static"
	{
		Console.WriteLine("Running CreateAction");
		return null;
	}
}

public interface IService { }
;